internal/lsp: new options to disable certain kinds of semantic tokens

Semantic tokens, as defined by the LSP, have no way of marking parts of
strings or numbers, for instance, to emphasize escape character. But
if gopls returns no semantic tokens for strings, then the editor
will use its coloring for strings, which may be more useful (and
similarly for components of numbers).

This change introduces boolean flags noSemanticString and
noSemanticNumber that can be set to true to suppress the semantic
token and let the editor's formatting shine through.

Fixes: Fixes golang/go#45753

Change-Id: Ibae880a08fb9a67daa73aa172375a1c949431e11
Reviewed-on: https://go-review.googlesource.com/c/tools/+/421256
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Peter Weinberger <pjw@google.com>
diff --git a/internal/lsp/source/api_json.go b/internal/lsp/source/api_json.go
index a613006..41f66d7 100755
--- a/internal/lsp/source/api_json.go
+++ b/internal/lsp/source/api_json.go
@@ -616,6 +616,22 @@
 				Hierarchy: "ui",
 			},
 			{
+				Name:      "noSemanticString",
+				Type:      "bool",
+				Doc:       "noSemanticString turns off the sending of the semantic token 'string'\n",
+				Default:   "false",
+				Status:    "experimental",
+				Hierarchy: "ui",
+			},
+			{
+				Name:      "noSemanticNumber",
+				Type:      "bool",
+				Doc:       "noSemanticNumber  turns off the sending of the semantic token 'number'\n",
+				Default:   "false",
+				Status:    "experimental",
+				Hierarchy: "ui",
+			},
+			{
 				Name:      "local",
 				Type:      "string",
 				Doc:       "local is the equivalent of the `goimports -local` flag, which puts\nimports beginning with this string after third-party packages. It should\nbe the prefix of the import path whose imports should be grouped\nseparately.\n",