Skip to content

Commit 936a813

Browse files
authored
Merge pull request #692 from julia-vscode/nonwsopt
add option to run linter on non-workspace files
2 parents 49afe6a + 339cb02 commit 936a813

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/languageserverinstance.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ mutable struct LanguageServerInstance
7171
SymbolServer.collect_extended_methods(SymbolServer.stdlibs),
7272
false,
7373
DocumentFormat.FormatOptions(),
74-
true,
74+
true,
7575
StaticLint.LintOptions(),
7676
:all,
7777
Channel{Any}(Inf),

src/requests/textdocument.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,10 @@ function mark_errors(doc, out = Diagnostic[])
292292
return out
293293
end
294294

295+
isunsavedfile(doc::Document) = startswith(doc._uri, "untitled:") # Not clear if this is consistent across editors.
296+
295297
function publish_diagnostics(doc::Document, server)
296-
if server.runlinter && server.symbol_store_ready && is_workspace_file(doc)
298+
if server.runlinter && server.symbol_store_ready && (is_workspace_file(doc) || isunsavedfile(doc))
297299
publishDiagnosticsParams = PublishDiagnosticsParams(doc._uri, doc._version, doc.diagnostics)
298300
else
299301
publishDiagnosticsParams = PublishDiagnosticsParams(doc._uri, doc._version, Diagnostic[])

0 commit comments

Comments
 (0)