-
Notifications
You must be signed in to change notification settings - Fork 223
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
Use slash / for package symbols #1660
Conversation
+++ metacp | ||
singleType { | ||
prefix { | ||
- symbol: "scala/util/Either." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only regression I can see, and the issue is already tracked in #1625 (comment) I will fix that issue later this week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out #1625 was unrelated after all, this regression has been fixed now.
Seems like my fix for
I will investigate later. |
Converts the interesting unit tests into expect tests.
Now that we have the capability to query the classpath if a symbol is a package we no longer need to resort to "smart tricks".
hasTermName seems to be required to catch a couple object symbols.
@@ -67,7 +67,8 @@ trait SymbolInformationOps { self: Scalacp => | |||
} | |||
val isModuleClass = sym.entry.entryType == 10 | |||
def isScalaObject: Boolean = isModuleClass && !sym.isJavaDefined | |||
if (hasTermName || isScalaObject) k.OBJECT | |||
if (sym.isPackageAccordingToClasspath) k.PACKAGE | |||
else if (hasTermName || isScalaObject) k.OBJECT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -2377,8 +2377,8 @@ In this section, we describe the Java symbol format. | |||
|
|||
**Descriptor** is: | |||
* For `LOCAL`, unsupported. | |||
* For `FIELD` or `PACKAGE`, concatenation of its simple name [\[98\]][98] | |||
and a dot (`.`). | |||
* For `PACKAGE`, concatenation of its encoded name and a forward slash (`/`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't look like the Java part of the spec defines what's an encoded name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -291,13 +291,13 @@ com.javacp.ClassSuffix#Inner#`<init>`(). | |||
- tag: PUBLIC | |||
- symbol: "" | |||
+ tag: PRIVATE_WITHIN | |||
+ symbol: "com.javacp." | |||
+ symbol: "com/javacp/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change is expected, it used to be com.javacp.
and is now com/javacp/
. Observe that the diff is only one line, the PRIVATE_WITHIN
diff is from the diff file itself, it's unchanged in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the Java spec to use "encoded name" everywhere.
Several followup fixes from #1660
Fixes #1647.
Fixes #1655 (remove redundant unit tests)
Fixes #1420 (package symbol language)
Currently, SemanticDB package symbols use
.
like forscala
inscala.Predef.String#
. This is problematic since it's not possible to distinguish packages from Scala objects likePredef
. This PR follows up on the proposal in #1647 to change the format to bescala/Predef.String#
instead. The benefit of this strategy is that we no longer need to persist package symbols and we can compute theirSymbolInformation
with a stateless method like this