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

Use project-local .curry as output directory if workspace contains multiple projects #56

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

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.

1 participant