Skip to content

fix(astro): using vim.fs.jointhpath concat path #3741

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

Merged
merged 1 commit into from
Apr 17, 2025

Conversation

glepnir
Copy link
Member

@glepnir glepnir commented Apr 17, 2025

Problem: hardcord path symbol in get_typescript_server_path

Solution: using vim.fs.joinpath to concat path

Problem: hardcord path symbol in get_typescript_server_path

Solution: using vim.fs.joinpath to concat path
@glepnir glepnir merged commit 8ec1327 into neovim:master Apr 17, 2025
11 checks passed
@glepnir glepnir deleted the fix_astro branch April 17, 2025 06:09
@@ -1,6 +1,6 @@
local function get_typescript_server_path(root_dir)
local project_root = vim.fs.dirname(vim.fs.find('node_modules', { path = root_dir, upward = true })[1])
return project_root and (project_root .. '/node_modules/typescript/lib') or ''
return project_root and vim.fs.joinpath(project_root, 'node_modules', 'typescript', 'lib') or ''
Copy link
Member

Choose a reason for hiding this comment

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

string literals don't need to be joined. just use "/".

 vim.fs.joinpath(project_root, 'node_modules/typescript/lib')

Copy link
Member Author

Choose a reason for hiding this comment

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

right it gsub path separator according to the system.

Copy link
Member

Choose a reason for hiding this comment

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

"/" works everywhere. platform-specific slash isn't needed.

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.

2 participants