I'm writing a language extension for lisp and have noticed a weird behavior. If I have something like this,
( "(" a b )
VSCode will match the closing parenthesis with the one in quotes. If I have the cursor between the a and the b and do an expand selection, it selects from the quoted open parens to the closing parens.
What controls this behavior? How do I get it to ignore the one in quotes?
I've tried messing with different settings in language-configuration.json, but nothing has worked so far. The only other thing I can think of would be the wordPattern regex, which I copied from somewhere. It's currently set to,
"wordPattern": "[^:()# \t\n\r][^:() \t\n\r]*"
Related
How can I select a XPath that contains a text with both quote & comma character?
I have to find an element if the text contains =Yes, It's OK
My XPath does not save in ranorex tool even though if i put the text inside the double quotes like below
//span[text()="Yes, It's OK"]
So how can I save this xpath that uses "".in Ranorex
your use of double-quotes is correct. if
//span[text()="Yes, It's OK"]
doesn't match, it might be because the xpath engine has a lowercase bug (i have encountered PHP+DOMXPath+libxml2 systems where it would only match lowercase text even for text with uppercase characters, never quite figured out the problem there), or it might be because the text has hidden whitespace you're not aware of, maybe it actually has a hard-to-spot whitespace at the start or the end? anyway maybe contains() will work:
//span[contains(text(),"Yes, It's OK"]
or.. if it has the lowercase-issue i have encountered in the wild once before, maybe this will work:
//span[contains(text(),"yes, it's ok"]
(that really shouldn't be required, but i have been in that situation once before, and that was years ago, and that was... probably php5)
By default, bracket matching doesn't understand strings and so will match brackets inside of quotes.
Steps to reproduce:
Start the language-configuration-sample extension
Type the following line in the file,
[ "]" ]
Move the cursor to the start of the line and hit Ctrl-\
The open bracket will match with the bracket inside the quotes.
The same behavior happens with anything defined as "brackets" in the config.
I've noticed language extensions like java, python, etc do not have this behavior. How do they get around it? I've looked through their code and haven't seen anything that looks related.
I've just recently updated my PhpStorm to version 8.0.3 and I've noticed a weird and rather annoying behavior when placing single or double quotes.
When I place a quote it gets underlined (img: http://i.imgur.com/qqoP4Gc.png) and when I try to write further it skips one letter, for example: I write a quote and try write a word:hello, what gets written - 'ello, when it should have been - 'hello.
How can I disable/fix this feature/bug?
Thank you in advance.
In IntelliJ IDEA 11 or 12, with an HTML file open, typing
<img src=
causes automatic insertion of double quotes, resulting in
<img src=""
Since I type ahead of where I read, this usually means I end up with something like
<img src=""image.png" alt="Image"/>"
How do I prevent double-quotes from being inserted automatically after attribute names?
In Intellij IDEA 14 and 15 (see #Zook's comment for IDEA 13), the option is now
Windows:
Menu File→Settings→Editor→General→Smart Keys→Add quotes for attribute value on typing '=' and attribute completion (under XML/HTML section on the right side of the Settings dialog)
Mac:
Preferences→Editor→General→Smart Keys→Add quotes for attribute value on typing '='
I don't know if it was the same for previous versions, but what actually happens in IDEA 14 is it automatically inserts both quotes and puts the cursor inside them. That's fine, but then when you type what you expect to be your opening double-quote, the smart punctuation mechanism thinks you're closing the quotes and skips you over the automatically-inserted close quote (the same as it does in e.g. java code when you type a closing parenthesis when it has already auto-inserted one). So you wind up with the cursor after the pair of quotes, typing your attribute value. This seems consistent with the original observation.
I would actually consider this a bug in IDEA but I guess the fact that opening and closing punctuation are the same symbol in this case makes things complicated. The smart punctuation mechanism would need to know to ignore the first quote you typed, but if you actually wanted to type an empty attribute value like src="", it would need to ignore the first quote and then jump over the close quote for the second one. Fiddly, but not impossible.
I've tried it with IDEA 12 and double quotes are inserted only after you start completing src attribute and press Enter or type = to confirm the completion. It doesn't happen automatically, you invoke completion that inserts quotes.
There is no option to control it, so you will have to break your habit to insert quotes manually and use Enter instead.
It's also possible to use the template completion with:
imgTab to generate <img src="" alt=""> with the caret inside first pair quotes.
Then just enter the image file name, Tab, enter alt text.
You can always submit a feature request to disable adding quotes on attributes completion.
Just change Input Language from "US - International" to "US". Switching to just "US" fixed the problem.
Read IntelliJ thread
I've made some good progress with my first attempt at a program, but have hit another road block. I'm taking standard output (as a string) froma console CMD window (results of dsquery piped to dsget) and have found small rectangles in the output. I tried using Regex to clean the little bastards but it seems they are related to the _ (underscore), which I need to keep (to return 2000/NT logins). Odd thing is - when I copy the caharcter and paste it into VS2K10 Express it acts like a carrige return??
Any ideas on finding out what these little SOB's are -- and how to remove them?
Going to try using /U or /A CMD switch next..
The square is often just used whenever a character is not displayable. The character could very well be a CR. You can use a Regular Expression to just get normal characters or remove the CR LF characters using string.replace.
You mentioned that you are using the string.replace function, and I am wondering if you are replacing the wrong character or something like that. If all your trying to do is remove a carriage return I would skip the regular expressions and stick with the string.replace.
Something like this should work...
strInputString = strInputString.replace(chr(13), "")
If not could you post a line or two of code.
On a side note, this might give some other examples....
Character replacement in strings in VB.NET