I want to disable word based suggestion, it's annoying and useless in my opinion. For example Brackets will offer suggestion for variables, methods and language and will not pollute the suggestion list with all similar words written in file.
I just want code suggestion. I tried "editor.wordBasedSuggestions": false, but no luck. How to change that ? Thanks.
Example:
Try adding:
"javascript.nameSuggestions": false
// Controls if suggestions should be accepted 'Enter' - in addition to 'Tab'. Helps to avoid ambiguity between inserting new lines or accepting suggestions.
"editor.acceptSuggestionOnEnter": "off"
from here
You can use this setting:
"editor.wordBasedSuggestions": false
You can use this one as I had problems with javascript function snippet not being on top
"editor.suggest.filteredTypes": {
"keyword": false
},
In UI it's:
Edit -> Perferences -> Settings -> Text Editor -> Suggestions -> Javascript > Suggest: Names
Related
I have a Vue project. When I go into my VS Code settings, I see an extension called "Vetur". I believe Vetur is what takes care of all code formatting for me. Under settings, when I click into Vetur, it gives me a list of different formatters for JS, CSS, HTML, etc. as they appear within Vue files. Here's a picture:
Picture of Vetur settings
The default formatter set for most things is something called prettier.
However, when I go into settings (which takes me to a file called settings.json), I don't see the word "prettier" there at all! Instead, I see a bunch of settings for other formatters that weren't selected (such as js-beautify-html), and the closest thing to the word "prettier" is the word "prettyhtml".
In the dropdown list for HTML, I do see an option for "prettyhtml", but it warns me that it's deprecated. Here's a screenshot: prettyhtml shown as a dropdown option but says it's deprecated.
When I go into this settings.json, I see this part:
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "force-expand-multiline"
},
"prettyhtml": {
"printWidth": 100,
"singleQuote": false,
"wrapAttributes": false,
"sortAttributes": false
}
}
Is "prettyhtml" the same thing as "prettier"?
If not, then why doesn't anything appear in settings.json for "prettier"? There are exactly zero string matches for the word "prettier" in settings.json.
This is all very confusing! Thanks.
Inspired by IntelliJ's 3 panel merge conflict view, I am trying to build something similar for vscode. I figured out, that I can integrate three complete customizable monaco-editors within a vscode Webview. But I cannot figure out, how monaco-editor applies the line padding in its diff-view like in the picture below (as I don't want to have a two-way but a 3-way diff using the internal diff-view is not an option for me):
Is it done through custom lineNumbers: lineNumber => isPaddingLine ? '' : lineNumber - someOffset, and inserting empty lines ("padding lines") at the related place and apply a deltaDecorations to those lines?
I hope there is a more easy way, which does not need the "padding lines" hack. Ideally I could just add something to a deltaDecoration like padding-bottom: $Xem
If I have just overlooked a way with vscode's api to achieve something like that, that would be of course more welcome than to deal directly with monaco-editor.
Thx a lot for any help / ideas :)
I finally found it :) IViewZone is the used magic.
And https://microsoft.github.io/monaco-editor/playground.html#interacting-with-the-editor-listening-to-mouse-events is a nice example
Is there a way to include CSS in HTML as one line, so lets say if i want to change the tabSize i will only need to do it once for both HTML and CSS
Currently looks like this:
"[html]": {
"editor.tabSize": 2,
},
"[css]": {
"editor.tabSize": 2
}
But i want something like this:
"[html, css]": {
"editor.tabSize": 2,
},
See the end of file-type specific settings issue. Multiple language keys in one setting are brought up (and earlier in the thread) but it is stated that there are no plans to support that (as of May, 2017).
So is later support of multiple langauges per key/entry something planned for the future?
Is there a sep[a]rate issue to track that?
[Response:] Its not yet planned.. Feel free to file an issue for that. Thanks.
I love eclipse auto formatting, but there's one feature that's driving me raging mad:
Since I use wrap-lines in my auto-formmatter, code like this:
private static Location _location = null; // this is a comment
turns into horrible, horrible code like this:
private static Location _location = null; // this
// is
// a
// comment
this is not only painful to watch, but not at all convenient to change back...
Is there any way to remove line-wrapping for comments, or at least fix so it doesn't look like an absolute mess?
Thanks
I think that the thing you are specifically asking about you can achieve by editing your formatter:
Window -> Preferences -> Java -> Code Style -> Formatter. There edit you click on Edit...
If you are using the default Eclipse formatter you will need to edit the profile name (you cna not edit built in profile).
Go to comments
Deselect line comment formatting.
That way no formatting of comments of the type // will be done.
This annoys me also. To fix the wrapped comments you can use the keyboard shortcut CTL+ALT+J to join the comments onto one line. The comment-indicator characters (// or *) will still be there but at least it will save you some steps. Then you can just run a find and replace for the comment-indicators.
There is a nice feature in Visual Studio: you can create special code areas which can be minimized just as class methods in Eclipse are minimized. Like:
#region
//some code
#endregion
Is there a way do make such pleasant feature in Eclipse?
It's called "collapse all", click on the editor view that you want to collapse all your methods in go to
help>
key assist...>
double click "collapse all">, everything is collapsed
Click on ' - (minus)' symbol on the side of the editor, Right click on minus symbol , Go to folding / Collapse All
Keyboard shortcut : Ctrl+Shift+NumbPad_Divide
First check Folding is enable or disable if enabled then you can minimize or collapse code and expand code. You can check Folding through
Folding is configured under Window -> Preferences -> Java -> Editor ->Folding
Please check Enable Folding if its unchecked
Now you can minimize your code
Collapse All (all functions on page) : Ctrl+Shift+NumbPad_Divide
Expand All (all function on page) : Ctrl+Shift+NumbPad_Mulitply
Collapse One function : Ctrl+NumbPad_Minus
Expand One Function : Ctrl+NumbPad_Plus
If you mean by minimizing folding, then I don't think Eclipse has the folding option you want. When I look at the eclipse folding options it tells me that it can fold
Comments
Header Comments
Inner Types
Members
Imports
If you don't mean folding, then I'm sorry for the confusion.
There are some plugins for this, like "Coffee Bytes Java Folding" for Eclipse.
Other IDE like Netbeans as an native equivalent.
It's really IDE dependent in Java, not implemented in the language like in C# for example.
Java Equivalent to #region in c#
Check the second answer
//region MY REGION
code here
//endregion
Heres how I do it:
Create an empty class called Blank
Use this outline for your code:
Blank b = new Blank()
{
public void myCode()
{
/Insert code here/
}
};
b.myCode();