fix: restore iota blocks, asm --format flag and prose after the syntax pass
This commit is contained in:
+3
-5
@@ -212,7 +212,7 @@ func (s *Server) documentFormatting(p documentFormattingParams) []TextEdit {
|
||||
if text == "" {
|
||||
return nil
|
||||
}
|
||||
formatted := format.Source(uriPath(p.TextDocument.URI), text)
|
||||
formatted := format.Source(text)
|
||||
if formatted == text {
|
||||
return nil
|
||||
}
|
||||
@@ -596,8 +596,7 @@ func classifyLine(line []token.Token, a *arch.Table, labels map[string]bool) []s
|
||||
case token.Hash:
|
||||
typ = stMacro
|
||||
case token.Ident:
|
||||
typ = classifyIdent(line, i, first, t.Text, a, labels,
|
||||
isDirective, isLabel, isInstr, &mnemonicDone)
|
||||
typ = classifyIdent(i, first, t.Text, a, labels, isDirective, isLabel, isInstr, &mnemonicDone)
|
||||
case token.Colon, token.Comma, token.LParen, token.RParen,
|
||||
token.Plus, token.Minus, token.Star, token.Slash, token.Dollar,
|
||||
token.LAngle, token.RAngle, token.LShift, token.RShift, token.Arrow, token.At:
|
||||
@@ -616,8 +615,7 @@ func classifyLine(line []token.Token, a *arch.Table, labels map[string]bool) []s
|
||||
}
|
||||
|
||||
// classifyIdent decides the semantic type of an identifier token.
|
||||
func classifyIdent(line []token.Token, i, first int, text string, a *arch.Table,
|
||||
labels map[string]bool, isDirective, isLabel, isInstr bool, mnemonicDone *bool) int {
|
||||
func classifyIdent(i, first int, text string, a *arch.Table, labels map[string]bool, isDirective, isLabel, isInstr bool, mnemonicDone *bool) int {
|
||||
|
||||
upper := strings.ToUpper(text)
|
||||
switch {
|
||||
|
||||
+1
-8
@@ -29,13 +29,8 @@ type rpcError struct {
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
// JSON-RPC error codes used by LSP.
|
||||
const (
|
||||
errParse = -32700
|
||||
errInvalidRequest = -32600
|
||||
errMethodNotFound = -32601
|
||||
errInvalidParams = -32602
|
||||
errInternal = -32603
|
||||
)
|
||||
|
||||
// --- LSP positions and ranges ----------------------------------------------
|
||||
@@ -119,16 +114,14 @@ type didCloseParams struct {
|
||||
|
||||
// --- completion -------------------------------------------------------------
|
||||
|
||||
// Completion item kinds (a useful subset).
|
||||
const (
|
||||
ciFunction = 3
|
||||
ciField = 5
|
||||
|
||||
ciVariable = 6
|
||||
ciClass = 7
|
||||
ciModule = 9
|
||||
ciKeyword = 14
|
||||
ciConstant = 21
|
||||
ciStruct = 22
|
||||
)
|
||||
|
||||
// CompletionItem is one completion suggestion.
|
||||
|
||||
Reference in New Issue
Block a user