Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add support for workspace#1238

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
sheetalkamat wants to merge2 commits intomain
base:main
Choose a base branch
Loading
fromworkspace
Open

Add support for workspace#1238

sheetalkamat wants to merge2 commits intomainfromworkspace

Conversation

sheetalkamat
Copy link
Member

No description provided.

@CopilotCopilotAI review requested due to automatic review settingsJune 19, 2025 20:04
Copy link
Contributor

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds workspace support by introducing a new Workspace structure and integrating workspace-related operations into project and LSP services. Key changes include updating the Workspace API (adding SetRoot, AddFolder, and RemoveFolder), refactoring OpenFile calls to remove redundant parameters, and adapting tests and server logic to work with the new workspace management.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
FileDescription
internal/project/workspace.goIntroduces Workspace struct with helper functions for folder management.
internal/project/workspace_test.goAdds tests validating GetProjectRootPath and folder addition/removal in a workspace context.
internal/project/service.go and related testsUpdates OpenFile signature and usage to derive project root path from Workspace instead of a parameter.
internal/lsp/server.goIntegrates workspace updates in LSP initialization and folder change notifications.
Others (service_test.go, projectreferencesprogram_test.go, etc.)Adjust tests to accommodate removal of the redundant projectRootPath parameter in OpenFile calls.
Comments suppressed due to low confidence (1)

internal/lsp/server.go:646

  • The handler uses 's.workspace' for updating workspace folders, but elsewhere workspace operations are performed through 's.projectService.Workspace'. To ensure consistency and avoid potential nil pointer issues, consider using 's.projectService.Workspace' or ensuring 's.workspace' is properly initialized.
s.workspace.AddFolder(ls.DocumentURIToFileName(lsproto.DocumentUri(folder.Uri)))

@sheetalkamatsheetalkamat marked this pull request as draftJune 19, 2025 20:28
@sheetalkamatsheetalkamat marked this pull request as ready for reviewJune 19, 2025 21:37
}
if s.initializeParams.WorkspaceFolders != nil {
for _, folder := range s.initializeParams.WorkspaceFolders.Value {
s.projectService.Workspace.AddFolder(ls.DocumentURIToFileName(lsproto.DocumentUri(folder.Uri)))
Copy link
Member

Choose a reason for hiding this comment

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

Do you know why we need to handle this kind of thing? Typically this stuff is only ever used if we plan to explicitly handle multi-root workspaces, but I don't think we have a reason to do that, since we're great at just accepting whatever gets opened anyway?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

this was used for creating better inferred projects - thats when projectRootPath was introduced
It is also used to not lookup tsconfig beyond the project root locations. I added this because with multi project thing the search locations increase and wanted to make sure i am not going beyond the point it needs to.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jakebaileyjakebaileyjakebailey left review comments

Copilot code reviewCopilotCopilot left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@sheetalkamat@jakebailey

[8]ページ先頭

©2009-2025 Movatter.jp