问题描述
最近,我已经安装了Ubuntu 20.04,并且试图将Sublime Text 3.2.2设置为可与Scala一起使用。我已经安装了SublimeLinter软件包,并使用SublimeLinter注释测试了它是否可以正常工作。
然后我安装了SublimeLinter-contrib-scalastyle,并按照this guide进行了设置。
当我在命令行中运行scalastyle
时,将获得预期的输出:
scalastyle 1.0.0
Usage: scalastyle [options] <source directory>
-c,--config FILE configuration file (required)
-v,--verbose true|false verbose output
-q,--quiet true|false be quiet
--xmlOutput FILE write checkstyle format output to this file
--xmlEncoding STRING encoding to use for the xml file
--inputEncoding STRING encoding for the source files
-w,--warnings true|false fail if there are warnings
-e,--externalJar FILE jar containing custom rules
-x,--excludedFiles STRING regular expressions to exclude file paths (delimited by semicolons)
SublimeLinter: ERROR:
=====================
scalastyle: Defining 'cls.Syntax' has no effect anymore. Use http://www.sublimelinter.com/en/stable/linter_settings.html#selector instead.
SublimeLinter: ERROR:
=====================
scalastyle disabled. 'selector' is mandatory in 'cls.defaults'.
See http://www.sublimelinter.com/en/stable/linter_settings.html#selector
但是,在我的配置中情况并非如此。 这是我的高级linter配置,其中删除了“语法”并添加了“选择器”:
{
// Set to true to print extra information in the console.
"debug": true,// When in the "background" lint mode,this value determines
// the minimum delay before a request is send to the linter
"delay": 0.1,// Available gutter themes:
// - BlueBerry Cross
// - BlueBerry Round
// - Circle
// - Danish Royalty
// - Default
// - Hands
// - Knob
// - Knob Symbol
// - Koloria
// - ProjectIcons
// Note that you may need to change the "icon" property in "styles"
// to an icon in the theme (they usually include "warning" and "error")
"gutter_theme": "Default",// Demote the visibility of a class off errors while you're editing.
// The errors will re-appear after `time_to_idle` and immediately on save.
// - ws_only: erroneous regions that contain only whitespace
// - some_ws: erroneous regions that contain *some* whitespace
// - multilines: multiline errors
// - warnings: errors of the "warning" type
// - all: demote all the things
// - none: disable this feature
"highlights.demote_while_editing": "none",// Apply a color (via scope) to the demoted errors.
// E.g. "" will hide the errors,"comment" is usually a subtle color.
"highlights.demote_scope": "",// How long to wait before showing the demoted errors again.
// Tip: A big value like 3600 will essentially hide the regions until
// you save the buffer.
"highlights.time_to_idle": 1.5,// Set to true to start the highlights hidden. Use the command
// "SublimeLinter: Toggle Highlights" to toggle the highlights
"highlights.start_hidden": false,// Send a "terminate" signal to old lint processes,if their result would
// be thrown away. If false we fire-and-forget processes instead.
"kill_old_processes": true,// Lint Mode determines when the linter is run.
// - background: asynchronously on every change
// - load_save: when a file is opened and every time it's saved
// - manual: only when calling the Lint This View command
// - save: only when a file is saved
"lint_mode": "background",// Linter specific settings.
// More info: http://www.sublimelinter.com/en/stable/linter_settings.html
// Linter specific settings except for 'styles' can also be changed
// in sublime-project settings.
// What settings are available is documented in the readme of the
// specific linter plugin.
// Example:
"linters": {
// The name of the linter you installed
"scalastyle": {
// disables the linter. The default here is 'not set'
"disable": false,// Additional arguments for the command line. Either a string
// or an array. If set to a string,we 'shlex.split' it*.
// E.g. '--ignore D112' or ['--config','./.config/foo.ini']
//
// * Note: Use proper quoting around paths esp. on Windows!
"args": [],// Path to the executable to be used. Either a string or an
// array. E.g. ['nvm','exec','8.6','eslint']
"executable": "scalastyle",// A modified runtime environment for the lint job. Settings here
// override the default,inherited ENV.
"env": {},// Exclude files that match the given pattern(s).
"excludes": [],// Suppress errors that match the the given pattern(s).
// Either a 'string' or an 'array'. Each input string is handled as
// a case-insensitive regex pattern and matched against the
// error_type,code,and message. If it matches,the error will be
// thrown away.
// E.g. ["warning: ","W3\d\d: ","missing <!DOCTYPE> declaration"]
"filter_errors": [],// Lint mode determines when the linter is run. The linter setting
// will take precedence over the global setting.
"lint_mode": "manual",// Determines for which views this linter will run.
"selector": "source.scala",// A list of additional style deFinition blocks.
"styles": [
{
// Instead of 'types' you can specify error 'codes' for
// a style deFinition block
"codes": [""]
}
],// The current working dir the lint job will run in.
"working_dir": "",// **Only valid for PythonLinter**
// Specify which python to use. Either a number or full path
// to a python binary. SL will then basically use 'python -m'
// to run the linter.
"python": 3,// **Only valid for NodeLinter**
// If true,will *not* use a globally installed binary
"disable_if_not_dependency": false
}
},// Determines what happens when a linter reports a problem without column.
// By default,a mark is put in the gutter and the first character is highlighted.
// If this setting is true,the entire line is also highlighted.
"no_column_highlights_line": false,// Provide extra paths to be searched when locating system executables.
"paths": {
"linux": [],"osx": [],"windows": []
},// Show a report for problems on a line by hovering over the gutter.
"show_hover_line_report": true,// Show a report for problems on a region by hovering over it.
"show_hover_region_report": true,// Highlight problems in the minimap.
"show_marks_in_minimap": true,// Show the output panel on save if there are problems.
// - window: check if the window has problems.
// - view: only check the current file.
// - never: disable this feature.
"show_panel_on_save": "never",// DEPRECATED: Not in use! Remove the setting from your User settings
// to avoid future warnings.
"statusbar.counters_template": "",// Show the messages for problems at your cursor position.
// - {message} will be replaced by the actual messages.
// - {linter} will be replaced by the linter reporting the error.
// - {type} will be replaced by either warning or error.
// - {code} will be replaced by the error code.
// Set to "" to display nothing
"statusbar.messages_template": "{message}","statusbar.show_active_linters": true,// Global styles for all linters.
// Note: Styles can also be specified per linter! See above.
// Only for linter-styles,there is one more setting:
// - codes:
// An array which can contain error codes provided by a linter.
// Only valid as linter style in the "linters" section
//
// The styles list form a stack evaluated top-down. We call each object
// herein a style deFinition. A style deFinition must match a specific
// linter error,either its code or its error type,to take any effect.
//
// The default styles cannot be overriden per se,you extend them
// in your user settings. The defaults can be read as "All linter problems
// are red,outline,dots,but warnings are yellow."
"styles": [
{
// Used to determine the color. E.g. region.<colorish>,with one of
// redish,orangish,yellowish,greenish,bluish,purplish,pinkish.
"scope": "region.yellowish markup.warning.sublime_linter",// The error type this style deFinition will match for.
// An array which can contain "warning" and/or "error".
// If omitted will match both.
"types": ["warning"]
},{
// Determines,for overlapping errors,which one is visualised.
"priority": 1,// The icon displayed in the gutter area
// - "circle","dot" or "bookmark"
// - "none" to remove the icon
// - A path to an icon file like
// "Packages/SublimeLinter/gutter-themes/BlueBerry Cross/error.png"
// - One provided by a gutter theme (e.g. "warning" or "error").
// In theme Default: warning,error,cog,x,// and diamond,heart,pointer,square,star,triangle,which all
// also have an -outline variant.
"icon": "dot",// The highlight style:
// - "none"
// - "fill","outline",// - "solid_underline","squiggly_underline","stippled_underline"
// In ST < 4074 the underline styles are replaced with outlines when
// there is whitespace in the problem region (ST issue #137).
// In newer versions underlines are replaced with outlines when
// there are newlines in the problem region for readability.
"mark_style": "outline","scope": "region.redish markup.error.sublime_linter"
}
],}
什么会导致Sublime Linter在scalastyle插件上失败?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)