Trying to change a few things like I had them in Xcode 3. I can't seem to get user defaults to work. These are the two changes I tried:
defaults write com.apple.Xcode XCCodeSenseFormattingOptions -dict PreExpressionSpacing ""
...which should change
if (...)
to
if(...)
and
defaults write com.apple.Xcode XCCodeSenseFormattingOptions -dict BlockSeparator "\\n"
...which should change
if(...){
}
to
if(...)
{
}
I also tried various permutations and variants like "\n" and others I found through a web search. Nothing makes XC4 behave differently. I can see the change when I use default read, but it does nothing to XC4.
BTW, I also tried something silly like:
defaults write com.apple.Xcode XCCodeSenseFormattingOptions -dict BlockSeparator "this is junk"
No changes whatsoever in XC4.
Any ideas?
Am I doing something wrong?
Thanks!
Related
I want to createTerminalEditor if there is no terminalEditor opened yet.
Note: I'm talking about terminalEditor and not terminal.
So, I'm looking for a when arg which says something like editorAlreadyExists != terminalEditor, just like there is activeEditor which aceepts string of terminalEditor.
Is there anyway to achieve this?
Here is activeEditor example for reference, but I want to check if terminalEditor exists in all the already opened editors, not just a activeEditor.
{
"key": "ctrl+`",
"command": "workbench.action.createTerminalEditor",
"when": "activeEditor != terminalEditor"
},
I see that there is a when clause for:
terminalEditorFocus: true/false
which doesn't look like it would help except for the fact that it isn't in the list (via Developer: Inspect Context Keys) at all when there is no terminal editor open. So I thought maybe there was a keybinding when clause that could exploit this. But I tried all kinds of thing, like whether it was null or undefined or the empty string or neither true nor false, etc. but nothing worked. I think if the key terminalEditorFocus doesn't exist, then nothing at all is delivered to the keybinding resolver and it always fails.
You could file an issue asking for a specific terminalEditorExists sort of when clause.
There will be another way. There is a presently experimental api to access all the open tabs. See proposed api. So you could write an extension that checks all the open tabs and fires the workbench.action.createTerminalEditor command if none are a terminalEditor. It works right now in the Insiders Build, but when it will go final I don't know - it seems pretty solid now. Issue: Tab Model API.
const tabs = vscode.window.tabs;
const openTerminalEditor = tabs.some(tab => tab.viewId === 'terminalEditor'); // true/false
Then you could either set your own context key with setContext or run the command.
I installed Babel("babel-cli": "^6.26.0") and and made a .babelrc like
{
"auxiliaryCommentBefore": "testBefore",
"auxiliaryCommentAfter": "testAfter"
}
and also made a simple test.js like
var a = 5;
and finally run babel test.js.
It secceded but no comment above is attached..
My expectation is something like below.
testBefore
var a = 5;
testAfter
Is there anything required missing??
The honest answer to your question is "they don't" :D
The specific behavior of those two options are extremely under-defined and I would love to rip them out of Babel entirely, and I would except that I don't want to needlessly break existing users when they upgrade.
If you need to annotate some input code in a particular way, you should write your own Babel plugin to inject whatever you need instead.
I have a test where I am using a expect #eventA-> eventually #eventB
else dut_error
However, my test treats that dut_error as a dut_warning and the test passed.
Is there any runtime switch in specman that downgrades all dut_errors to dut_warnings ?
For changing the effect of all checks, you cal also issue
"set check WARNING"
I recommend that you give names to the checks, among other things - it simplifies controlling their effect.
e.g. -
expect data_flow is #eventA-> eventually #eventB else ...
and then -
set check -name = my_checker.data_flow WARNING;
A nice thing is that if you name the expect, you can override it.
expect data_flow #eventA-> {[3..13]; #eventB} else ...
Yes, set_check can change the error level.
extend sys {
setup() is also {
set_check("...", WARNING);
};
};
I use two different languages.
I would like to switch Capslock and LShift, but only for one of them.
Basically I want to do this:
if (A_Language = "0409")
{
Capslock::LShift
LShift::Capslock
}
// else behave like normal
When I write it like this, the keys are always swapped, no matter the language.
You need to use #if to create context-sensitive hotkeys.
You can read more here: http://ahkscript.org/docs/commands/_If.htm
Also, make sure you're running the latest version of AHK, otherwise it might not work.
#if (A_Language = "0409")
Capslock::LShift
LShift::Capslock
#if
So, a simple little question. Every time I perform some transaction with DataMapper inside one of my "get" or "post" blocks, I get output looking something like this...
core.local - - [19/Sep/2012:09:04:54 CEST] "GET /eval_workpiece/state?id=24 HTTP/1.1" 200 4
- -> /eval_workpiece/state?id=24
It's a little too verbose for my liking. Can I turn this feedback off?
This isn’t Datamapper logging, this is the logging done by the WEBrick server, which logs all requests using these two formats by default.
(Note this isn’t Rack logging either, although the Rack::CommonLogger uses the same (or at least very similar) format).
The simplest way to stop this would be to switch to another server that doesn’t add its own logging, such as Thin.
If you want to continue using WEBrick, you’ll need to find a way to pass options to it from your Sinatra app. The current released Sinatra gem (1.3.3) doesn’t allow an easy way to do this, but the current master allows you to set the :server_options setting which Sinatra will then pass on. So in the future you should be able to do this:
set :server_settings, {:AccessLog => []}
in order to silence WEBrick.
For the time being you can add something like this to the end of your app file (I’m assuming you’re launching your app with something like ruby my_app_file.rb):
disable :run
Sinatra::Application.run! do |server|
server.config[:AccessLog] = []
end
To cut off all logging:
DataMapper.logger = nil
To change verbosity:
DataMapper.logger.set_log(logger, :warn) # where logger is Sinatra's logging object
Other levels are :fatal => 7, :error => 6, :warn => 4, :info => 3, :debug => 0 (http://rubydoc.info/gems/dm-core/1.1.0/DataMapper/Logger)
If you're running with ActiveSupport, you can use the Kernel extension:
quietly { perform_a_noisy_task }
This temporarily binds STDOUT and SDTERR to /dev/null for the duration of the block. Since you may not want to suppress all output, theoretically you can do:
with_warnings(:warn) { # or :fatal or :error or :info or :debug
perform_a_noisy_task
}
and appropriate messages will be suppressed. (NB: I say 'theoretically' because using with_warnings gave me a seemingly unrelated error in my Padrino/DataMapper environment. YMMV.)