-
Notifications
You must be signed in to change notification settings - Fork 18
Serokell Grant 2 Milestone 3 #414
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
Open
heitor-lassarote
wants to merge
14
commits into
caffeinelabs:master
Choose a base branch
from
serokell:grant-2-milestone-3
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Serokell Grant 2 Milestone 3 #414
heitor-lassarote
wants to merge
14
commits into
caffeinelabs:master
from
serokell:grant-2-milestone-3
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Problems: 1. Completion list contains not relevant identifiers 2. Completion item details contains only module name 3. Completion items lack of documentation. Solution: 1. Analyze code block containing the current cursor position to show only relevant identifiers. 2. When item type is available show the item type as a detail. 3. Show documentation if it exists for the completion item.
Problem: Currently implemented code actions `organize imports` and `quick fix import` are implemented but not covered by tests. Solution: Implement tests for `organize import` and `quick fix import`. NB: currently organize imports does not work correctly. The corresponding test is commented out for now and should be enabled after organize imports is fixed.
Problem: `WorkspaceSymbol` capability handler is implemented but is not covered by tests. Solution: Implement `WorkspaceSymbol` capability tests. NB: The implementation of the capability handler should be improved by providing more relevant `SymbolKind`. After that tests should be fixed accordingly.
Problem: Document symbol capability handler is implemented but is not covered by tests. Solution: Implement tests for document symbol capability. NB: The support for more symbol kinds should be added to the handler an the tests.
Problem: Before we implement rename, we need prepare rename. This request checks the validity of a rename. Solution: Implement a simple handler that checks whether the position is an ID node, that is not a keyword, or type name.
Problem: We need the references handler to implement rename. As it is now, we can't easily call it, so let's refactor it out, into its own file. Solution: Copy and paste the references handler into a new file.
Problem: Now that prepare rename is implemented, we can implement rename. Solution: This request is simple: we find all references of whatever is under the cursor, and create an edit for all of them. We add tests to ensure this capability works as intended, by reusing both the definitions and prepare rename tests.
Problem: When searching for an ID, we always assume it's a variable. However, it could be a type. Solution: For now, check if we are in a `TypD` and return a `'type'` if so. This is not perfect, but gets the test to pass.
Problem: 1. Currently the language server returns full completion list relevant for current scope. The list filtering is provided on client side. Current test implementation implies filtering on server side. 2. One formatting test sometimes fail with timeout. Solution: 1. Add completion items to expected list. 2. Intcearse timeout for the test.
Problem: signature help hint works only if we have typed AST available. Until we don't input full function parameters we have invalid function typing and building typed AST fails. That's why signature help is not fully functional. Solution: After implementing type recovery in motoko it became possible to make signature help fully functional. Several regression tests was added.
Problem: Now that we have better support for recovering the typed AST for dot expressions in the compiler, we should also add a test for it in the extension. Solution: Add a test checking that we can complete from a local module and another that we can complete from a nested module. While testing, I found that we don't properly filter items based on their prefix, so I added this case for completions from definitions.
Problem: According to the LSP specification, the server should not filter items unless we send `isIncomplete` is `true`. However, this would cause the client to recompute the list on every keystroke, and since we rely on `findDefinitions`, which is slow, we don't want this. Solution: Do not filter items based on a prefix. To check for the items, order, and continuity in a subarray, we had to write a custom Jest matcher. Set `isIncomplete` as `false` since we now send the complete list.
Problem: Different projects can use different compiler versions. VSCode extension should adapt to the project's version. Solution: 1. If path to moc.js compiler is configured in the extension settings, try to use that compiler. 2. If the configured moc.js does not exist in the path, try to download it. 3. If path to moc.js not configured or there are problems with using it, try to detect current project compiler version and download the compiler if it does not exist. 4. Otherwise use default moc.js
Problem: tsconfig.json complains that all source files must be under src, but the jest setup is outside. Solution: Move the relevant files inside and update the config.
This was referenced Dec 15, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains changes related to Serokell's second grant, third milestone.
Related PRs: