22
33import com .sourcegraph .scip .LocalSymbolsCache ;
44import com .sourcegraph .scip .ScipDocumentBuilder ;
5- import com .sourcegraph .scip .ScipRanges ;
6- import com .sourcegraph .scip .ScipRanges .Range ;
5+ import com .sourcegraph .scip .ScipRange ;
76import com .sourcegraph .scip .ScipSymbols ;
87import com .sun .source .tree .AnnotatedTypeTree ;
98import com .sun .source .tree .ClassTree ;
@@ -184,7 +183,7 @@ private void resolveMethodTree(MethodTree node, TreePath treePath) {
184183 private void resolveVariableTree (VariableTree node , TreePath treePath ) {
185184 Element sym = trees .getElement (treePath );
186185 if (sym == null ) return ;
187- Range range =
186+ ScipRange range =
188187 emitDefinition (sym , node , sym .getSimpleName (), CompilerRange .FROM_POINT_WITH_TEXT_SEARCH );
189188 if (sym .getKind () == ElementKind .ENUM_CONSTANT ) {
190189 TreePath typeTreePath = nodes .get (node .getInitializer ());
@@ -248,8 +247,8 @@ private void resolveNewClassTree(NewClassTree node, TreePath treePath) {
248247 // =======================================
249248 // Occurrence + SymbolInformation emission
250249 // =======================================
251- private Range emitDefinition (Element sym , Tree tree , Name name , CompilerRange kind ) {
252- Range range = computeRange (tree , kind , sym , name == null ? null : name .toString ());
250+ private ScipRange emitDefinition (Element sym , Tree tree , Name name , CompilerRange kind ) {
251+ ScipRange range = computeRange (tree , kind , sym , name == null ? null : name .toString ());
253252 if (range == null ) return null ;
254253 emitOccurrence (sym , range , SymbolRole .Definition_VALUE , computeEnclosingRange (tree ));
255254 declTrees .put (sym , tree );
@@ -258,12 +257,12 @@ private Range emitDefinition(Element sym, Tree tree, Name name, CompilerRange ki
258257 }
259258
260259 private void emitReference (Element sym , Tree tree , Name name , CompilerRange kind ) {
261- Range range = computeRange (tree , kind , sym , name == null ? null : name .toString ());
260+ ScipRange range = computeRange (tree , kind , sym , name == null ? null : name .toString ());
262261 if (range == null ) return ;
263262 emitOccurrence (sym , range , 0 /* reference */ , null );
264263 }
265264
266- private void emitOccurrence (Element sym , Range range , int role , Range enclosingRange ) {
265+ private void emitOccurrence (Element sym , ScipRange range , int role , ScipRange enclosingRange ) {
267266 String symbol = scipSymbol (sym );
268267 if (symbol .isEmpty ()) return ;
269268 Occurrence .Builder b = Occurrence .newBuilder ().setSymbol (symbol ).setSymbolRoles (role );
@@ -370,7 +369,7 @@ private SymbolInformation.Kind scipKind(Element sym) {
370369 // =======================================
371370 // Source position / range computation
372371 // =======================================
373- private Range computeRange (Tree tree , CompilerRange kind , Element sym , String name ) {
372+ private ScipRange computeRange (Tree tree , CompilerRange kind , Element sym , String name ) {
374373 if (sym == null ) return null ;
375374 SourcePositions sourcePositions = trees .getSourcePositions ();
376375 int start = (int ) sourcePositions .getStartPosition (compUnitTree , tree );
@@ -404,7 +403,7 @@ private Range computeRange(Tree tree, CompilerRange kind, Element sym, String na
404403 return lineMapRange (start , end );
405404 }
406405
407- private Range computeEnclosingRange (Tree tree ) {
406+ private ScipRange computeEnclosingRange (Tree tree ) {
408407 if (tree == null ) return null ;
409408 TreePath path = nodes .get (tree );
410409 if (path == null ) return null ;
@@ -423,7 +422,7 @@ private Range computeEnclosingRange(Tree tree) {
423422 return lineMapRange (start , end );
424423 }
425424
426- private Range lineMapRange (int start , int end ) {
425+ private ScipRange lineMapRange (int start , int end ) {
427426 if (start == Diagnostic .NOPOS || end == Diagnostic .NOPOS || end <= start ) return null ;
428427 LineMap lineMap = compUnitTree .getLineMap ();
429428 int startLine = (int ) lineMap .getLineNumber (start ) - 1 ;
@@ -441,8 +440,8 @@ private Range lineMapRange(int start, int end) {
441440 endChar -= count * 7 ;
442441 }
443442
444- if (startLine == endLine ) return ScipRanges . singleLineRange (startLine , startChar , endChar );
445- return ScipRanges .range (startLine , startChar , endLine , endChar );
443+ if (startLine == endLine ) return ScipRange . singleLine (startLine , startChar , endChar );
444+ return ScipRange .range (startLine , startChar , endLine , endChar );
446445 }
447446
448447 // =======================================
0 commit comments