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

Custom databases (Salsa support) #79

Closed
brendanzab opened this issue Jun 6, 2019 · 4 comments · Fixed by #164
Closed

Custom databases (Salsa support) #79

brendanzab opened this issue Jun 6, 2019 · 4 comments · Fixed by #164

Comments

@brendanzab
Copy link
Owner

It would be nice to be able to define custom Files-style databases depending on the needs of a project.

  • People might want to use something like Salsa to manage their source files.
  • When starting off building a language, a 'SingleFile' database (that only took a single file) might be a better solution than Add emit_single, which emits a Diagnostic given a single FileMap #56.
  • Others might want to use a more compact span representation than the one used currently. For example compressing it, as is done in rustc.

The language-reporting fork defines ReportingSpan and ReportingFiles traits which might be useful for inspiration.

@brendanzab
Copy link
Owner Author

Inching towards a Files trait here: https://github.com/brendanzab/codespan/compare/traits

Still does not compile though - working through how to pull everything out nicely. The crate structure is a tad awkward though - now codespan is only depended on in order to implement Span and Files.

@brendanzab
Copy link
Owner Author

I think it'd probably also be nice to implement the LSP support in terms of these traits too.

@brendanzab
Copy link
Owner Author

It would also be interesting if we could have a subtrait that also provided URLs for codespan-lsp, which would mean we wouldn't have to supply the correlate_file_url closure.

@Marwes
Copy link
Collaborator

Marwes commented Oct 4, 2019

Getting some sort of trait in would be nice before upgrading for me as the lack of being able to take individual Arc<FileMap> out makes it impossible to work with Files concurrently (reading from one file while adding others).

I can take https://github.com/brendanzab/codespan/compare/traits and get it working but I don't really know if we must/should make any additional changes to the traits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants