Skip to content

Commit

Permalink
Merge pull request #719 from ezemtsov/master
Browse files Browse the repository at this point in the history
Add fsautocomplete
  • Loading branch information
manateelazycat authored Sep 27, 2023
2 parents e37e962 + 42749e5 commit 7fb813d
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ lsp-bridge first looks for the content of the first *.pub file in the `~/.ssh` d
- `acm-backend-search-file-words-candidate-min-length`: The minimum characters to trigger search file words completion, default is 0
- `acm-backend-search-file-words-max-number`: Search Words completion candidate limit, default is 10
- `acm-backend-search-file-words-enable-fuzzy-match`: Search Words completion candidate fuzzy match, disable by default
- `acm-backend-search-file-words-enable-fuzzy-match-threshold`: Search Words completion candidate fuzzy match threshold, Filter out words with a ratio lower than the threshold, default is 50
- `acm-backend-search-file-words-enable-fuzzy-match-threshold`: Search Words completion candidate fuzzy match threshold, Filter out words with a ratio lower than the threshold, default is 50
- `acm-backend-codeium-candidate-min-length`: The minimum characters to trigger codeium completion, default is 0
- `acm-backend-lsp-enable-auto-import`: automatic insert import code, enable by default
- `acm-backend-lsp-candidate-max-length`: Maximum length of LSP candidate, some language, such as Java, argument list is very long, you can increase the value of this option to see clear argument list
Expand Down Expand Up @@ -302,7 +302,7 @@ If your language supports mixed multi-language servers, it is recommended to che
| [dart-analysis-server](https://github.com/dart-lang/sdk/tree/master/pkg/analysis_server) | Dart | |
| [metals](https://scalameta.org/metals/) | Scala | |
| [typescript](https://github.com/typescript-language-server/typescript-language-server) | Typescript, Javascript | |
| [svelte](https://github.com/sveltejs/language-tools/tree/master/packages/language-server) | Svelte | |
| [svelte](https://github.com/sveltejs/language-tools/tree/master/packages/language-server) | Svelte | |
| [ocamllsp](https://github.com/ocaml/ocaml-lsp) | Ocaml | |
| [erlang-ls](https://github.com/erlang-ls/erlang_ls) | Erlang | |
| [texlab](https://github.com/latex-lsp/texlab) | Latex | |
Expand Down Expand Up @@ -338,6 +338,7 @@ If your language supports mixed multi-language servers, it is recommended to che
| [sourcekit-lsp](https://github.com/apple/sourcekit-lsp) | Swift | The SourceKit-LSP server is included with the Swift toolchain. |
| [omnisharp-mono](https://github.com/OmniSharp/omnisharp-roslyn) | C# | OmniSharp is a .NET development platform based on Roslyn workspaces. use `M-x lsp-bridge-install-omnisharp` to install it. `lsp-bridge-csharp-lsp-server` set to `omnisharp-mono` |
| [omnisharp-dotnet](https://github.com/OmniSharp/omnisharp-roslyn) | C# | OmniSharp is a .NET development platform based on Roslyn workspaces. use `M-x lsp-bridge-install-omnisharp` to install it. `lsp-bridge-csharp-lsp-server` set to `omnisharp-dotnet` (6.0) |
| [fsautocomplete](https://github.com/fsharp/FsAutoComplete) | F# | |
| [deno](https://deno.land) | Deno | Deno runtime use TypeScript as source code, you need customize option `lsp-bridge-get-single-lang-server-by-project` that return result "deno" when `project-path` match Deno project. |
| [ansible-language-server](https://github.com/ansible/ansible-language-server) | Ansible | Ansible uses YAML as source code, you’ll need to customize `lsp-bridge-get-single-lang-server-by-project` to return "ansible-language-server". |
| [astro](https://github.com/withastro/language-tools/tree/main/packages/language-server) | Astro | `npm i -g @astrojs/language-server` |
Expand Down
83 changes: 83 additions & 0 deletions langserver/fsautocomplete.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"name": "fsautocomplete",
"languageId": "f#",
"command": [
"fsautocomplete",
"--adaptive-lsp-server-enabled"
],
"initializationOptions": {
"automaticWorkspaceInit": true,
"abstractClassStubGeneration": true,
"abstractClassStubGenerationMethodBody": "failwith \"Not Implemented\"",
"abstractClassStubGenerationObjectIdentifier": "this",
"addFsiWatcher": null,
"codeLenses": {
"references": {
"enabled": "true"
},
"signature": {
"enabled": "true"
}
},
"disableFailedProjectNotifications": null,
"dotnetRoot": "",
"enableAdaptiveLspServer": true,
"enableAnalyzers": null,
"enableMSBuildProjectGraph": null,
"enableReferenceCodeLens": true,
"excludeProjectDirectories": [".git", "paket-files", ".fable", "packages", "node_modules"],
"externalAutocomplete": null,
"fsac": {
"attachDebugger": "null",
"cachedTypeCheckCount": 200,
"conserveMemory": null,
"dotnetArgs": null,
"netCoreDllPath": "",
"parallelReferenceResolution": null,
"silencedLogs": null
},
"fsiExtraParameters": null,
"fsiSdkFilePath": "",
"generateBinlog": null,
"indentationSize": 4,
"inlayHints": {
"disableLongTooltip": null,
"enabled": true,
"parameterNames": true,
"typeAnnotations": true
},
"inlineValues": {
"enabled": null,
"prefix": "//"
},
"interfaceStubGeneration": true,
"interfaceStubGenerationMethodBody": "failwith \"Not Implemented\"",
"interfaceStubGenerationObjectIdentifier": "this",
"keywordsAutocomplete": true,
"lineLens": {
"enabled": "replaceCodeLens",
"prefix": " // "
},
"inter": true,
"pipelineHints": {
"enabled": true,
"prefix": " // "
},
"recordStubGeneration": true,
"recordStubGenerationBody": "failwith \"Not Implemented\"",
"resolveNamespaces": true,
"saveOnSendLastSelection": null,
"simplifyNameAnalyzer": true,
"smartIndent": null,
"suggestGitignore": true,
"suggestSdkScripts": true,
"unionCaseStubGeneration": true,
"unionCaseStubGenerationBody": "failwith \"Not Implemented\"",
"unusedDeclarationsAnalyzer": true,
"unusedOpensAnalyzer": true,
"verboseLogging": null,
"workspaceModePeekDeepLevel": 4,
"workspacePath": ""
},
"support-single-file": false
}
5 changes: 4 additions & 1 deletion lsp-bridge.el
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ Then LSP-Bridge will start by gdb, please send new issue with `*lsp-bridge*' buf
(verilog-mode . "verible")
(vhdl-mode . "vhdl-tool")
(svelte-mode . "svelteserver")
(fsharp-mode . "fsautocomplete")
)
"The lang server rule for file mode."
:type 'cons)
Expand Down Expand Up @@ -536,6 +537,7 @@ Then LSP-Bridge will start by gdb, please send new issue with `*lsp-bridge*' buf
go-ts-mode-hook
yaml-ts-mode-hook
svelte-mode-hook
fsharp-mode-hook
)
"The default mode hook to enable lsp-bridge."
:type '(repeat variable))
Expand Down Expand Up @@ -604,6 +606,7 @@ you can customize `lsp-bridge-get-workspace-folder' to return workspace folder p
(go-mode . c-basic-offset) ;Golang
(go-ts-mode . c-basic-offset) ;Golang
(svelte-mode . js-indent-level) ;Svelte
(fsharp-mode . fsharp-indent-offset) ; F#
(default . standard-indent)) ; default fallback
"A mapping from `major-mode' to its indent variable.")

Expand Down Expand Up @@ -1254,7 +1257,7 @@ So we build this macro to restore postion after code format."
(lsp-bridge-is-remote-file))
(setq-local lsp-bridge--before-change-begin-point begin)
(setq-local lsp-bridge--before-change-end-point end)

(setq-local lsp-bridge--before-change-begin-pos (lsp-bridge--point-position begin))
(setq-local lsp-bridge--before-change-end-pos (lsp-bridge--point-position end))
)))
Expand Down

0 comments on commit 7fb813d

Please sign in to comment.