Skip to content

Commit

Permalink
use os.path.normpath to remove the trailing / of project path
Browse files Browse the repository at this point in the history
dir-locals-find-file will return project directory ending with /, which make
os.path.basename to return empty string, so I add os.path.normpath to remove the
trailing /.
  • Loading branch information
fuyu0425 committed Oct 4, 2024
1 parent 2d0cd0b commit 543194e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/lspserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class LspServer:
def __init__(self, message_queue, project_path, server_info, server_name, enable_diagnostics):
self.message_queue = message_queue
self.project_path = project_path
self.project_name = os.path.basename(project_path)
self.project_name = os.path.basename(os.path.normpath(project_path))
self.server_info = server_info

self.initialize_id = generate_request_id()
Expand Down

0 comments on commit 543194e

Please sign in to comment.