vscode is not respecting editor.quickSuggestions setttings - visual-studio-code

In vscode, I have the following setttings:
"editor.quickSuggestions": {
"other": true,
"comments": true,
"strings": true
},
"[markdown]": {
"editor.quickSuggestions": {
"other": true,
"comments": true,
"strings": true
},
I am debugging this issue for plugin Markdown Notes.
I believe at some point the settings value for editor.quickSuggestions changed from a boolean to the new mapping. In any case, in a document I have the text:
#draft
#d
And this used to autocomplete the tag text immediately, respecting the quickSuggestions preference.
Now, I don't get an automatic autocomplete, BUT I DO get the correct autocomplete values when I triggerSuggest (⌃Space by default).
So vscode DOES know the correct completion values, but it just will not respect the quickSuggestions settting.
Is there some other new setting I need to toggle to get quickSuggestions working correctly?

Maybe you have
{
"editor.suggestOnTriggerCharacters": true
}
set to false?

Related

How can I set a background image to vs code?

I am currently using Vs Code. But I don't know much about the IDE. I want to set a background image to IDE. Is it possible?
I've been searching for weeks.
I installed an extension named background from shalldie. I have changed the json code with this:
{
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs":"active",
"background.enabled": true,
"background.loop": false,
"background.useDefault": false,
"background.useFront": false,
"background.style": {
"content": "''",
"pointer-events": "none",
"position": "absolute",
"z-index": "99999",
"width": "70%",
"height": "100%",
"margin-left":"30%",
"background-position": "right",
"background-size": "cover",
"background-repeat": "no-repeat",
"opacity": 0.1
},
"background.customImages": [
"file//C:/madara.jpg",
]
}
after this, vs code wanted me to reload the IDE and I did. but nothing have changed.
After all this, I got another notification that says "Bracket Pair Colorizer is no longer being maintained.". But I don't know what does it mean.
I am using windows 10.
what do I need to do now?
file:///C:/madara.jpg
your path should add a '/' before drive letter

TinyMce attribute invalid_elements does not prevent from indicated tags to be used or pasted, why is this happening?

I've been trying to use the invalid_elements property inside the window.tinymce.init object but to no avail, invalid elements and valid_elements (i.e. , , etc) keeps apearing if i paste something or if i select the bold option for instance. I also tried the paste_word_valid_elements: 'b,strong,i,em,h1,h2', property, without any positive results.
Also, in this site https://www.tiny.cloud/docs/demo/valid-elements/ you can try the properties i mentioned above and they still not work... why is that??
is this ment to be this way, is it a bug or am i missing something while coding it.
this is the object i'm passing to the init method:
selector: `#${(target as HTMLDivElement).id}`,
plugins: "paste",
inline: true, // does not work in mobile
forced_root_block: true,
force_br_newlines: false,
force_p_newlines: false,
invalid_elements : 'strong,em',
paste_merge_formats: true,
paste_preprocess: (plugin: any, args: any) => {
console.log("que trae",args.content);
console.log(">>>>>>>>", args.content.split('</p>'));
},
paste_word_valid_elements: 'b,strong,i,em,h1,h2',
}```

VSCode How to _enable_ Regex Find by command, rather than "toggle"

I want to write a macro to search for a Regex in VSCode.
Examining the different functionalities available in the editor I find toggleFindRegex, (bound to key Alt-R by default) which works well for interactive use.
However, for a macro a "toggle" won't do. The result could be "on" or "off", fifty-fifty random from the macro's point of view.
Ideally I would need an enableFindRegex function, which doesn't seem to exist, or alternatively a way for the macro to detect the current findRegex state before deciding whether to toggle it or not.
So could anybody point me in the right direction on this?
This can be done with a Joyride function
(defn find-with-regex-on []
(let [selection vscode/window.activeTextEditor.selection
document vscode/window.activeTextEditor.document
selectedText (.getText document selection)
regexp-chars (js/RegExp. #"[.?+*^$\\|(){}[\]]" "g")
newline-chars (js/RegExp. #"\n" "g")
escapedText (-> selectedText
(.replace regexp-chars "\\$&")
(.replace newline-chars "\\n?$&"))]
(vscode/commands.executeCommand
"editor.actions.findWithArgs"
#js {:isRegex true
:searchString escapedText})))
And binding a keyboard shortcut to that function:
{
"key": "cmd+ctrl+alt+f",
"command": "joyride.runCode",
"args": "(my-lib/find-with-regex-on)",
},
Here's the full example: https://github.com/BetterThanTomorrow/joyride/blob/master/examples/README.md#find-in-file-with-regexp-toggled-on
You can use this command in a macro since support for its arguments has recently been added:
{
"command": "editor.actions.findWithArgs",
"args": {
// "findInSelection": false,
// "isCaseSensitive": true,
// "matchCaseOverride": 0, // appears to not be implemented
// "preserveCase": true,
// "preserveCaseOverride": 0, // appears to not be implemented
"isRegex": true
// "regexOverride": 1, // appears to not be implemented
// "replaceString": "asdasd",
// "searchString": "qweqwe",
// "matchWholeWord": true,
// "wholeWordOverride": 0 // appears to not be implemented
}
}
This will open the Find Widget with the regex option chosen. Of course, you can utilize the other args if you want - some have not been implemented and intellisense is poorly done on this command in the keybindings - I have indicated which args have not been implemented and/or the correct key names.
----- Previous answer --------------
In v1.46 is the ability to open a new search editor (not the search panel), with various arguments including whether the regex button should be on or off.
See
SearchEditor: Open new editor with args
. So this works:
{
"key": "ctrl+shift+g",
"command": "search.action.openNewEditor",
"args": {
"query": "\\w*",
"regexp": true,
"includes": "${fileDirname}", // restrict to current editor's directory
// "includes": "${file}", // restrict search to current file
"showIncludesExcludes": true,
"contextLines": 3,
},
"when": "editorTextFocus"
},
whether the regex option was previously selected or not. Other arguments available:
{
query: string,
includes: string,
excludes: string,
contextLines: number,
wholeWord: boolean,
caseSensitive: boolean,
regexp: boolean,
useIgnores: boolean,
showIncludesExcludes: boolean,
// triggerSearch: boolean, // to be in v.47
// focusResults: boolean // to be in v.47
}
Prior to triggerSearch and focusResults being added to the Stable version (presumably 1.47) here is a macro that immediately runs the search and focuses the first result:
"multiCommand.commands": [
{
"command": "multiCommand.runSearchEditorwithArguments",
"interval": 200, // needs a small delay so results are loaded before focusing them
"sequence": [
{
"command": "search.action.openNewEditor",
"args": {
"query": "(TODO|NOTE|BUG):",
"regexp": true,
"includes": "${fileDirname}",
"showIncludesExcludes": true,
"contextLines": 3,
}
},
"rerunSearchEditorSearch", // runs the search
"search.action.focusNextSearchResult" // focus first result
]
}
]

VSCode. How do I remove padding between side bar and editor?

I somehow added padding to the left and right of my editor. Anyone know how I could remove it?
I've played around with view->editor layout but Single mode doesn't do the trick. And switching to the other views and back don't do anything either. I also can't drag the window beyond what is shown below.
my current settings.json, nothing in here should affect it.
{
"editor.tabSize": 2,
"editor.detectIndentation": false,
"window.zoomLevel": 1,
"editor.minimap.enabled": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"[terraform]": {
"editor.formatOnSave": true
},
"breadcrumbs.enabled": true,
"[python]": {
"editor.insertSpaces": true,
"editor.tabSize": 4
},
"editor.renderWhitespace": "none"
}
Seems like it was answered on github. I just wasn't typing in the correct question. https://github.com/Microsoft/vscode/issues/53778
F1->Toggle Center Layout
In settings
"editor.glyphMargin": false

How to select tab-size in Visual Code Studio for pug lang?

It is possible to set lang-based tabe sizes in VSC like this:
"[sass]": {
"editor.tabSize": 2
},
"[html]": {
"editor.tabSize": 4
},
"[javascript]": {
"editor.tabSize": 2
}
But its doesnt work for pug language, where identation is always 4 spaces. It doesnt even overwrite with "editor.tabSize: 2". How do i make another value of tabsize for pug ?
Found a solution:
"[jade]": {
"editor.detectIndentation": false,
"editor.insertSpaces": true,
"editor.tabSize": 2
}
Jade was name of the Pug template before.
https://github.com/pugjs/pug/issues/2184