Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make lsp-fsharp directory exclusion more configurable #4049

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions clients/lsp-fsharp.el
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ available, else the globally installed tool."
:type 'boolean
:risky t)

(defcustom lsp-fsharp-workspace-extra-exclude-dirs '()
"Additional directories to exclude from FsAutoComplete workspace loading / discovery."
:group 'lsp-fsharp
:type '(repeat string))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be lsp-string-vector. Why did you change the default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh jeeze, I completely lost track of this. Apologies!

I'll get this updated.


(defun lsp-fsharp--fsac-cmd ()
"The location of fsautocomplete executable."
(or (-let [maybe-local-executable (expand-file-name "fsautocomplete" lsp-fsharp-server-install-dir)]
Expand Down Expand Up @@ -221,10 +226,12 @@ available, else the globally installed tool."

(defun lsp-fsharp--project-list (workspace)
"Get the list of files we need to send to fsharp/workspaceLoad."
(let* ((response (lsp-request "fsharp/workspacePeek"
(let* ((base-exlude-dirs ["paket-files" ".git" "packages" "node_modules"])
(exclude-dirs (apply 'vector (append base-exlude-dirs lsp-fsharp-workspace-extra-exclude-dirs)))
(response (lsp-request "fsharp/workspacePeek"
`(:directory ,(lsp--workspace-root workspace)
:deep 10
:excludedDirs ["paket-files" ".git" "packages" "node_modules"])))
:excludedDirs ,exclude-dirs)))
(data (lsp--read-json (lsp-get response :content)))
(found (-> data (lsp-get :Data) (lsp-get :Found)))
(directory (seq-find (lambda (d) (equal "directory" (lsp-get d :Type))) found)))
Expand Down