Skip to content

Conversation

@fwcd
Copy link
Owner

@fwcd fwcd commented Jun 15, 2023

Consider the following project layout

<workspace>
├─ .curry
├─ project1
│  ├─ .curry
│  ├─ src
│  └─ package.json
└─ project2
   ├─ .curry
   ├─ src
   └─ package.json

Currently, the language server will use <workspace>/.curry as an output directory in any case since defaultOutDir points to ./.curry and the language server's working directory is the workspace:

outDirPath = CFN.defaultOutDir </> "language-server"

Given that the user will compile projects anyway from their respective subdirectories, it would make sense for the language server to use the local .curry directories as well, which is what this PR does. This additionally prevents clashes if the user has a module under the same name in multiple packages and unexpected cross-visibility between packages in the same workspace once compiled.

Some more testing is needed, however, especially to make sure that dependencies use the correct out dir too etc.

I.e. if the workspace contains multiple Curry projects, e.g. CPM
packages, the language server will place icurry files for each project
in its own <workspace>/<project dir>/.curry/language-server rather than
<workspace>/.curry/language-server.

Strangely, however, there still seem to be some files written to the
workspace's folder, presumably those from the standard library etc.
which don't have an associated dirPath.
@fwcd fwcd added the enhancement New feature or request label Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants