Skip to content

Commit

Permalink
Make Goto Definition work for jdt:// URIs (#43)
Browse files Browse the repository at this point in the history
This allows us to browse standard-library files and 3rd-party jars.
  • Loading branch information
rwols authored Oct 16, 2023
1 parent 6dc519f commit a929eeb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/jdtls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import re

import sublime
from urllib.parse import urlparse
from LSP.plugin import (
AbstractPlugin,
Request,
Expand Down Expand Up @@ -171,7 +172,7 @@ def on_pre_start(
"progressReportProvider": configuration.settings.get(
SETTING_PROGRESS_REPORT_ENABLED
),
"classFileContentsSupport": False,
"classFileContentsSupport": True,
"overrideMethodsPromptSupport": False,
"hashCodeEqualsPromptSupport": False,
"advancedOrganizeImportsSupport": False,
Expand Down Expand Up @@ -212,7 +213,11 @@ def on_open_uri_async(
Request(
"java/classFileContents", text_document_identifier(uri), progress=True
),
lambda resp: callback(uri, resp, "Packages/Java/Java.sublime-syntax"),
lambda resp: callback(
urlparse(uri).path,
resp,
"Packages/Java/Java.sublime-syntax"
),
lambda err: callback(
"ERROR", str(err), "Packages/Text/Plain text.tmLanguage"
),
Expand Down

0 comments on commit a929eeb

Please sign in to comment.