Skip to content

Feature/issue 117 lsp vscode extension#141

Open
yaswanth169 wants to merge 3 commits intoboyland:masterfrom
yaswanth169:feature/issue-117-lsp-vscode-extension
Open

Feature/issue 117 lsp vscode extension#141
yaswanth169 wants to merge 3 commits intoboyland:masterfrom
yaswanth169:feature/issue-117-lsp-vscode-extension

Conversation

@yaswanth169
Copy link
Copy Markdown

Summary

  • Adds a Java LSP server (edu.cmu.cs.sasylf.lsp) built on LSP4J 0.21.1,
    reusing 100% of the existing SASyLF parser and typechecker
  • Adds a VSCode extension (vscode-sasylf/) with syntax highlighting,
    real-time diagnostics, hover, code completion, document symbols,
    and go-to-definition
  • Packages as a fat JAR (sasylf-lsp.jar) and .vsix for easy install

Features

  • Diagnostics: Real-time error/warning squiggles from the SASyLF typechecker
  • Syntax Highlighting: TextMate grammar for keywords, rule separators,
    comments, ::=
  • Document Symbols: Outline view showing syntax, judgments (with nested
    rules), and theorems
  • Hover: Shows judgment form, theorem kind, syntax info on mouse-over
  • Completion: Keywords + all in-scope theorems, rules, judgments, syntax
  • Go to Definition: Jump to declaration in the current file

How to install

cd vscode-sasylf
npm install && npx tsc -p ./
npx @vscode/vsce package --allow-missing-repository
code --install-extension sasylf-0.1.0.vsix

Test plan

  • Open a .slf file in VSCode — syntax highlighting appears
  • Errors/warnings show as squiggles in real time
  • Outline view shows judgments, theorems, syntax
  • Hover on a judgment/theorem shows its info
  • Completion suggests keywords and rule/theorem names
  • Existing regression tests still pass (182/188, same as master)

Fixes #117.

…ies; - Add IMPORTS token and grammar section in parser (before requires); - Add imports field and addImportChunk() to CompUnit; - Error IMPORT_IN_REQUIRES when rename-syntax is placed in requires; - Fix RenameSyntaxDeclaration.copy() to keep original reference (identity); - Fix RenameSyntaxDeclaration.substitute() to not mutate cached original; - Fix RenameJudgment.substitute() to not mutate cached original; - Fix SyntaxDeclaration.copy() null guard for gnt/gt fields; - Add modulegood12 regression test for imports section; - Add modulebad11 regression test for IMPORT_IN_REQUIRES error
…plement Java LSP server using LSP4J (diagnostics, hover, completion, document symbols, go-to-definition); - Add VSCode extension with TextMate grammar for syntax highlighting; - Bundle as fat JAR (sasylf-lsp.jar) launched via stdio; - Extension packaged as sasylf-0.1.0.vsix
Copy link
Copy Markdown
Owner

@boyland boyland left a comment

Choose a reason for hiding this comment

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

This is an unacceptable PR. It includes far too many things. It also seems ignorant of the fact that there already is a PR about the lsp. Don't do another PR yet on the existing PR.

@yaswanth169
Copy link
Copy Markdown
Author

Regarding the LSP work, I had already gone through the existing PR earlier while working on this, and I was aware of its direction. While reviewing it, I noticed a few areas where some edge cases or completeness might need further attention, especially around integration with the current parser/typechecker and certain feature behaviors.

Over the past couple of months, I’ve been working closely with the codebase and diving fairly deep into it, so this implementation was an attempt to explore those gaps and extend the functionality further.

That said, I understand your concern about the size and scope of this PR it does bundle too many things together. I’ll pause on this and instead align with the existing PR, contributing in a more focused and incremental way.

I’ll also check with you before proceeding further to make sure everything stays aligned with the project direction.

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 this pull request may close these issues.

Implement a Language Server Protocol or VSCode extension for SASyLF

2 participants