@@ -332,11 +332,10 @@ public Optional<CompletionList> completion(TextDocumentPositionParams position)
332332 var started = Instant .now ();
333333 var uri = position .textDocument .uri ;
334334 if (!FileStore .isJavaFile (uri )) return Optional .empty ();
335- var content = FileStore .contents (uri );
336335 var line = position .position .line + 1 ;
337336 var column = position .position .character + 1 ;
338337 // Figure out what kind of completion we want to do
339- var maybeCtx = compiler .parseFile (uri , content ).completionContext (line , column );
338+ var maybeCtx = compiler .parseFile (uri ).completionContext (line , column );
340339 // TODO don't complete inside of comments
341340 if (!maybeCtx .isPresent ()) {
342341 var items = new ArrayList <CompletionItem >();
@@ -353,7 +352,7 @@ public Optional<CompletionList> completion(TextDocumentPositionParams position)
353352 var ctx = maybeCtx .get ();
354353 // TODO CompileFocus should have a "patch" mechanism where we recompile the current file without creating a new
355354 // task
356- var focus = compiler .compileFocus (uri , content , ctx .line , ctx .character );
355+ var focus = compiler .compileFocus (uri , ctx .line , ctx .character );
357356 // Do a specific type of completion
358357 List <Completion > cs ;
359358 boolean isIncomplete ;
@@ -624,7 +623,7 @@ private void updateActiveFile(URI uri) {
624623 || !activeFileCache .file .equals (uri )
625624 || activeFileCacheVersion != FileStore .version (uri )) {
626625 LOG .info ("Recompile active file..." );
627- activeFileCache = compiler .compileFile (uri , FileStore . contents ( uri ) );
626+ activeFileCache = compiler .compileFile (uri );
628627 activeFileCacheVersion = FileStore .version (uri );
629628 }
630629 }
@@ -738,12 +737,11 @@ private SignatureHelp asSignatureHelp(MethodInvocation invoke) {
738737 public Optional <SignatureHelp > signatureHelp (TextDocumentPositionParams position ) {
739738 var uri = position .textDocument .uri ;
740739 if (!FileStore .isJavaFile (uri )) return Optional .empty ();
741- var content = FileStore .contents (uri );
742740 var line = position .position .line + 1 ;
743741 var column = position .position .character + 1 ;
744742 // TODO CompileFocus should have a "patch" mechanism where we recompile the current file without creating a new
745743 // task
746- var focus = compiler .compileFocus (uri , content , line , column );
744+ var focus = compiler .compileFocus (uri , line , column );
747745 var help = focus .methodInvocation ().map (this ::asSignatureHelp );
748746 return help ;
749747 }
@@ -835,8 +833,7 @@ private List<JavaFileObject> pruneWord(Collection<URI> files, Element el) {
835833 if (name .equals ("<init>" )) name = el .getEnclosingElement ().getSimpleName ().toString ();
836834 var sources = new ArrayList <JavaFileObject >();
837835 for (var f : files ) {
838- var contents = FileStore .contents (f );
839- var pruned = Pruner .prune (f , contents , name );
836+ var pruned = Pruner .prune (f , name );
840837 sources .add (new SourceFileObject (f , pruned ));
841838 }
842839 return sources ;
@@ -858,7 +855,7 @@ private List<JavaFileObject> latestText(Collection<URI> files) {
858855 private void updateCachedParse (URI file ) {
859856 if (file .equals (cacheParseFile ) && FileStore .version (file ) == cacheParseVersion ) return ;
860857 LOG .info (String .format ("Updating cached parse file to %s" , file ));
861- cacheParse = compiler .parseFile (file , FileStore . contents ( file ) );
858+ cacheParse = compiler .parseFile (file );
862859 cacheParseFile = file ;
863860 cacheParseVersion = FileStore .version (file );
864861 }
0 commit comments