I'm using Sublime Text 3 and SublimeLinter CSSLint.
How can I disable the order-alphabetical warnings?
I've found this link:
https://github.com/SublimeLinter/SublimeLinter-csslint/issues/15
Preferences > Package Settings > SublimeLinter > Settings.
I get this window:
Then what?
Someone suggested the following code:
"linters": {
"csslint": {
"#disable": false,
"args": [],
"errors": "",
"excludes": [],
"ignore": ["order-alphabetical"],
"warnings": ""
},
I've tried copying and pasting into the right hand pane (// SublimeLinter Settings - User) but I get an error message:
What am I doing wrong? Should I paste this into the left pane/window? Do I delete the text "// SublimeLinter Settings - User"?
Thank you
While Sublime Text allows comments in its JSON-like settings format, you need to make sure the rest of notation is valid. Hence, your settings should look something like this:
{
"linters": {
"csslint": {
"#disable": false,
"args": [],
"errors": "",
"excludes": [],
"ignore": ["order-alphabetical"],
"warnings": ""
}
}
}
Related
I use some files written with Gherkin mode, but they don't have the ".feature" extension. I tried to change some visual code files related to cucumber extension to be able to highlight files that are not .feature but I had no success.
For example:
Workspace settings.json:
{
"folders": [
{
"path": "/home/user/git"
},
{
"path": "/home/user/Documents/scripts"
}
],
"settings": {}
"cucumberautocomplete.steps": [
"*.myext"
],
"cucumberautocomplete.syncfeatures": "*.myext",
"cucumberautocomplete.strictGherkinCompletion": true
}
It worked changing the file /home/user/.config/Code/User/settings.json and adding this config:
"files.associations": {
"*.myext": "feature"
}
{
"editor.renderWhitespace": "all",
"window.titleBarStyle": "custom",
"editor.fontSize": 15,
"python.jediEnabled": false,
"terminal.integrated.shell.linux": "/bin/bash",
"workbench.colorTheme": "Visual Studio Dark",
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"[feature]": {
},
"files.associations": {
"*.myext": "feature"
}
}
<?php
namespace App\Http\Controllers\Admin;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
class AdminHomeController extends Controller
{
public function index()
{
return view('AdminHome')->withPages(Page::all());
}
}
when i press ctrL+s to save it ,then some code is deleted . I don't know why ,can you give me a solution ?
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
class AdminHomeController extends Controller {
public function index() {
return view('AdminHome')->withPages(Page::all());
}
}
the code become like this .
I installed packages for my sublime text 3 ,in the follow picture . I think it's caused by sublimeLinter , but I don't kow how to fix it , my user settings as follows:
enter image description here
{
"user": {
"debug": false,
"delay": 0.15,
"error_color": "D02000",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "load/save",
"linters": {
"php": {
"#disable": false,
"args": [],
"excludes": []
},
"phplint": {
"#disable": false,
"args": [],
"excludes": []
}
},
"mark_style": "outline",
"no_column_highlights_line": false,
"passive_warnings": false,
"paths": {
"linux": [],
"osx": [],
"windows": [
"D:\\wamp64\\bin\\php\\php7.0.4"
]
},
"python_paths": {
"linux": [],
"osx": [],
"windows": []
},
"rc_search_limit": 3,
"shell_timeout": 10,
"show_errors_on_save": false,
"show_marks_in_minimap": true,
"syntax_map": {
"html (django)": "html",
"html (rails)": "html",
"html 5": "html",
"javascript (babel)": "javascript",
"magicpython": "python",
"php": "html",
"python django": "python",
"pythonimproved": "python"
},
"warning_color": "DDB700",
"wrap_find": true
}
}
This is the first time I ask question on this website ,and I am from China , my English is not very good .
your issue is reported before from phpfmt users. under package settings-> phpfmt -> setting - User then add "passes": ["OnlyOrderUseClauses"]. have a look on this issue
update: the working format is "passes": "OnlyOrderUseClauses", as #SHUIPING_YANG mentioned
I had the same issue, but couldn't figure out exactly why Sublime always deleting my PHP use statements; Moreover, while trying to troubleshoot the issue, I realized that my Sublime packages differed from the ones you had installed. Expect for one, that was SublimeCodeIntel. I removed it, and upon pressing Ctrl + S, Sublime no longer removed the use statements.
While running Sublime Text 3 and VS Code (or Atom) with the Monokai color theme, the Sublime Text syntax highlighting uses blue for function calls, such as in the example below
However, when I open the same code in VS Code using the monokai theme, functions are not painted blue
I would really like to change that, the code looks much better with function calls highlighted. However, I looked around the web and couldn't find how to change this behavior. Does anyone have any tips for that?
Thanks!
SEE UPDATE BELOW!
Seems like I've found a temporary solution. Go to this folder (if you are on Mac) /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/theme-monokai/themes and put this code in monokai-color-theme.json file:
{
"name": "Function call",
"scope": "meta.function-call.generic",
"settings": {
"foreground": "#66d9efff"
}
},
Here is an example how it can look like:
screenshot
But keep in mind, that after theme update this changes may disappear!
UPDATE:
After having a couple more troubles with highlighting, I decided to upload the file with theme to GitHub and keep it up to date. So, if you don't want to dive into the code, just look in my repository: https://github.com/spyker77/monokai-theme-extended
UPDATE (April 2021)
It turns out that the previous solution is not sustainable. Therefore at the moment a better one could be:
In you Visual Studio Code go to "Code" => "Preferences" => "Color Theme" and pick Monokai;
Open settings.json file (how-to);
There will probably already be a bunch of settings in there, so all you need to do is just add the following customisations at the end and before the closing brace (don't forget a trailing comma after the last setting you continue):
"editor.tokenColorCustomizations": {
"[Monokai]": {
"textMateRules": [
{
"name": "Decorator definition decorator",
"scope": "punctuation.definition.decorator.python",
"settings": {
"foreground": "#F92672"
}
},
{
"name": "Meta function-call",
"scope": "meta.function-call.generic.python",
"settings": {
"foreground": "#66D9EF"
}
},
{
"name": "Storage type function async",
"scope": "storage.type.function.async.python",
"settings": {
"foreground": "#F92672",
}
},
{
"name": "Punctuation separator period",
"scope": "punctuation.separator.period.python",
"settings": {
"foreground": "#F8F8F2",
}
},
{
"name": "Entity name function decorator",
"scope": "entity.name.function.decorator.python",
"settings": {
"foreground": "#66D9EF",
}
},
{
"name": "Entity name type class",
"scope": "entity.name.type.class.python",
"settings": {
"fontStyle": ""
}
},
{
"name": "Entity other inherited-class",
"scope": "entity.other.inherited-class.python",
"settings": {
"fontStyle": "italic"
}
},
{
"name": "Support type python",
"scope": "support.type.python",
"settings": {
"fontStyle": ""
}
},
{
"name": "String quoted docstring multi python",
"scope": "string.quoted.docstring.multi.python",
"settings": {
"foreground": "#88846F",
}
}
]
}
}
after trying for server hours finally found a solution and I came back to you to share the solution since I tried the answer above and couldn't make it work.
it turns out that the problem I with VScode extensions (python for Vscode), so disable that first,extension
then go to your setting.json file like that how to open setting
add this to the top of your file
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "meta.function-call.generic",
"settings": {
"foreground":"#19D1E5"
}
}
]
},
and restart VScode and this should work, btw I am using monokai vibrent, and I am sure it will work in any theme you like.
setting.json
like this here
In settings.json:
"editor.tokenColorCustomizations": {
"[Monokai]": {
{
"scope": "entity.name.function",
"settings": {
"foreground": "#fdc306d0", // use your desired color
"fontStyle": "underline" // I like this, foreground color has some reduced opacity
}
}
}
}
might do the trick.
I'm having difficulty setting user settings for SublimeLinter in SublimeText3. I've checked here: http://www.sublimelinter.com/en/latest/settings.html
I've tried setting my user settings, and setting "max-line-length" to 80 (the default is 100):
{
"user": {
"debug": false,
"delay": 0.25,
"error_color": "D02000",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "background",
"linters": {
"pylint": {
"#disable": false,
"args": [],
"disable": "",
"enable": "",
"excludes": [],
"max-line-length": 80,
"paths": [],
"rcfile": "",
"show-codes": false
}
},
"mark_style": "outline",
"no_column_highlights_line": true,
"passive_warnings": false,
"paths": {
"linux": [],
"osx": [],
"windows": []
},
"python_paths": {
"linux": [],
"osx": [],
"windows": []
},
"rc_search_limit": 3,
"shell_timeout": 10,
"show_errors_on_save": false,
"show_marks_in_minimap": true,
"syntax_map": {
"html (django)": "html",
"html (rails)": "html",
"html 5": "html",
"php": "html",
"python django": "python"
},
"warning_color": "DDB700",
"wrap_find": true
}
}
However, this setting is not applied. I have closed and re-opened sublime text. How do I get this setting to be applied? Thanks.
The syntax you are using seems to work for some linters, however, as far as I know it doesn't works for pylint.
Anyway, for using pylint from Sublime Text you can use the command argument --max-line-length=N,
so change
"args": []
for
"args": ["--max-line-length=90"]
In addition, if you do this, remove the max-line-length property.
Edit: where to place SublimeLinter settings.
You can learn about it in the SublimeLinter settings documentation
I used the user-settings-file, that you can usually find using the following menu option: Preferences > Package Settings > SublimeLinter > Settings-User. For this purpose you need to add the option inside linters/pylint:
{
"user": {
"linters": {
"pylint": {
// "exampleOtion": "exampleValue",
"args": ["--max-line-length=90"]
}
}
}
}
Please note that probably your config file is similar to the one in the question, so you just need to add the new option inside "pylint" without breaking the JSON format
As this message continues to appear regularly on the first page of Google and SublimeLinter has changed a lot, here is my solution:
I enter "pref lint" or "preferences linter" in the Command Palette in sublime text 3 (screenshot) to open the preferences file.
Here's the SublimeLinter.sublime-settings default config file I am using (W0312 is for using tabs instead of spaces):
// SublimeLinter Settings - User
{
"linters": {
"pylint": {
"filter_errors": ["warning:", "W0312"]
}
}
}
I use pylint-messages to find the right error/warning codes, with the help of the search box.
I want to suppress various kind of useless linter error reports, e.g. lacks "content" attribute. So I tried experimenting with setting the options in SublimeLinter.sublime-settings:
"linters": {
"htmltidy": {
"#disable": false,
"args": [-xxx true],
"excludes": []
}
},
and so on and they don't seem to do anything. Am I doing something wrong?
The settings file is a JSON file, and it looks like your edits are not valid JSON. Try putting quotes around the args, either:
"args": ["-xxx true"]
or
"args": ["-xxx", "true"]
This worked for me:
"linters": {
"htmltidy": {
"#disable": false,
"args": [
//http://tidy.sourceforge.net/docs/quickref.html
"--drop-proprietary-attributes", "false"
],
"excludes": []
}...