-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
2,190 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// 版权 @2024 凹语言 作者。保留所有权利。 | ||
|
||
package source | ||
|
||
import "wa-lang.org/wa/internal/lsp/protocol" | ||
|
||
// Analyzer represents a go/analysis analyzer with some boolean properties | ||
// that let the user know how to use the analyzer. | ||
type Analyzer struct { | ||
// Analyzer *analysis.Analyzer | ||
|
||
// Enabled reports whether the analyzer is enabled. This value can be | ||
// configured per-analysis in user settings. For staticcheck analyzers, | ||
// the value of the Staticcheck setting overrides this field. | ||
Enabled bool | ||
|
||
// Fix is the name of the suggested fix name used to invoke the suggested | ||
// fixes for the analyzer. It is non-empty if we expect this analyzer to | ||
// provide its fix separately from its diagnostics. That is, we should apply | ||
// the analyzer's suggested fixes through a Command, not a TextEdit. | ||
Fix string | ||
|
||
// ActionKind is the kind of code action this analyzer produces. If | ||
// unspecified the type defaults to quickfix. | ||
ActionKind []protocol.CodeActionKind | ||
|
||
// Severity is the severity set for diagnostics reported by this | ||
// analyzer. If left unset it defaults to Warning. | ||
Severity protocol.DiagnosticSeverity | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// 版权 @2024 凹语言 作者。保留所有权利。 | ||
|
||
package source | ||
|
||
import ( | ||
"wa-lang.org/wa/internal/lsp/protocol" | ||
"wa-lang.org/wa/internal/lsp/span" | ||
) | ||
|
||
type SuggestedFix struct { | ||
Title string | ||
Edits map[span.URI][]protocol.TextEdit | ||
Command *protocol.Command | ||
ActionKind protocol.CodeActionKind | ||
} | ||
|
||
type RelatedInformation struct { | ||
URI span.URI | ||
Range protocol.Range | ||
Message string | ||
} | ||
|
||
// An Diagnostic corresponds to an LSP Diagnostic. | ||
// https://microsoft.github.io/language-server-protocol/specification#diagnostic | ||
type Diagnostic struct { | ||
URI span.URI | ||
Range protocol.Range | ||
Severity protocol.DiagnosticSeverity | ||
Code string | ||
CodeHref string | ||
|
||
// Source is a human-readable description of the source of the error. | ||
// Diagnostics generated by an analysis.Analyzer set it to Analyzer.Name. | ||
Source string | ||
|
||
Message string | ||
|
||
Tags []protocol.DiagnosticTag | ||
Related []RelatedInformation | ||
|
||
// Fields below are used internally to generate quick fixes. They aren't | ||
// part of the LSP spec and don't leave the server. | ||
SuggestedFixes []SuggestedFix | ||
Analyzer *Analyzer | ||
} |
Oops, something went wrong.