test_class.declarator: documentManager
test_class.modifier: private
test_class.original_string: private WorkspaceDocumentManagerImpl documentManager;
test_class.type: WorkspaceDocumentManagerImpl
test_class.var_name: documentManager
test_class.declarator: filePath
test_class.modifier: private
test_class.original_string: private Path filePath;
test_class.type: Path
test_class.var_name: filePath
test_class.declarator: docUpdatePath1
test_class.modifier: private
test_class.original_string: private Path docUpdatePath1;
test_class.type: Path
test_class.var_name: docUpdatePath1
test_class.declarator: docUpdatePath2
test_class.modifier: private
test_class.original_string: private Path docUpdatePath2;
test_class.type: Path
test_class.var_name: docUpdatePath2
test_class.declarator: docUpdatePath3
test_class.modifier: private
test_class.original_string: private Path docUpdatePath3;
test_class.type: Path
test_class.var_name: docUpdatePath3
test_class.declarator: RES_DIR = Paths.get("src/test/resources/").toAbsolutePath()
test_class.modifier: public static final
test_class.original_string: public static final Path RES_DIR = Paths.get("src/test/resources/").toAbsolutePath();
test_class.type: Path
test_class.var_name: RES_DIR
test_class.file: language-server/modules/langserver-compiler/src/test/java/org/ballerinalang/langserver/compiler/workspace/WorkspaceDocumentManagerImplTest.java
test_class.identifier: WorkspaceDocumentManagerImplTest
test_case.body: @Test
      public void testOpenFile() throws IOException, WorkspaceDocumentException {
          // Call open file
          Optional<Lock> lock = documentManager.lockFile(filePath);
          try {
              documentManager.openFile(filePath, readAll(filePath.toFile()));
              documentManager.openFile(docUpdatePath1, new String(Files.readAllBytes(docUpdatePath1)));
              documentManager.openFile(docUpdatePath2, new String(Files.readAllBytes(docUpdatePath2)));
              documentManager.openFile(docUpdatePath3, new String(Files.readAllBytes(docUpdatePath3)));
          } finally {
              lock.ifPresent(Lock::unlock);
          }
          // Test file opened
          Path foundPath = documentManager.getAllFilePaths().stream().filter(path -> {
              try {
                  return Files.isSameFile(path, filePath);
              } catch (IOException e) {
                  return false;
              }
          }).findFirst().orElse(null);
          Assert.assertNotNull(foundPath);
      }
test_case.class_method_signature: WorkspaceDocumentManagerImplTest.testOpenFile()
test_case.full_signature: @Test public void testOpenFile()
test_case.identifier: testOpenFile
test_case.invocations: lockFile openFile readAll toFile openFile readAllBytes openFile readAllBytes openFile readAllBytes ifPresent orElse findFirst filter stream getAllFilePaths isSameFile assertNotNull
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testOpenFile()
focal_class.declarator: documentList = new ConcurrentHashMap<>()
focal_class.modifier: private volatile
focal_class.original_string: private volatile Map<Path, DocumentPair> documentList = new ConcurrentHashMap<>();
focal_class.type: Map<Path, DocumentPair>
focal_class.var_name: documentList
focal_class.declarator: INSTANCE = new WorkspaceDocumentManagerImpl()
focal_class.modifier: private static final
focal_class.original_string: private static final WorkspaceDocumentManagerImpl INSTANCE = new WorkspaceDocumentManagerImpl();
focal_class.type: WorkspaceDocumentManagerImpl
focal_class.var_name: INSTANCE
focal_class.file: language-server/modules/langserver-compiler/src/main/java/org/ballerinalang/langserver/compiler/workspace/WorkspaceDocumentManagerImpl.java
focal_class.identifier: WorkspaceDocumentManagerImpl
focal_class.interfaces: implements WorkspaceDocumentManager
focal_class.class_method_signature: WorkspaceDocumentManagerImpl.WorkspaceDocumentManagerImpl()
focal_class.full_signature: protected  WorkspaceDocumentManagerImpl()
focal_class.identifier: WorkspaceDocumentManagerImpl
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.signature:  WorkspaceDocumentManagerImpl()
focal_class.class_method_signature: WorkspaceDocumentManagerImpl.getInstance()
focal_class.full_signature: public static WorkspaceDocumentManagerImpl getInstance()
focal_class.identifier: getInstance
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: WorkspaceDocumentManagerImpl
focal_class.signature: WorkspaceDocumentManagerImpl getInstance()
focal_class.class_method_signature: WorkspaceDocumentManagerImpl.isFileOpen(Path filePath)
focal_class.full_signature: @Override public boolean isFileOpen(Path filePath)
focal_class.identifier: isFileOpen
focal_class.modifiers: @Override public
focal_class.parameters: (Path filePath)
focal_class.return: boolean
focal_class.signature: boolean isFileOpen(Path filePath)
focal_class.class_method_signature: WorkspaceDocumentManagerImpl.openFile(Path filePath, String content)
focal_class.full_signature: @Override public void openFile(Path filePath, String content)
focal_class.identifier: openFile
focal_class.modifiers: @Override public
focal_class.parameters: (Path filePath, String content)
focal_class.return: void
focal_class.signature: void openFile(Path filePath, String content)
focal_class.class_method_signature: WorkspaceDocumentManagerImpl.updateFile(Path filePath, List<TextDocumentContentChangeEvent> changeEvent)
focal_class.full_signature: @Override public void updateFile(Path filePath, List<TextDocumentContentChangeEvent> changeEvent)
focal_class.identifier: updateFile
focal_class.modifiers: @Override public
focal_class.parameters: (Path filePath, List<TextDocumentContentChangeEvent> changeEvent)
focal_class.return: void
focal_class.signature: void updateFile(Path filePath, List<TextDocumentContentChangeEvent> changeEvent)
focal_class.class_method_signature: WorkspaceDocumentManagerImpl.getTextRange(TextDocument textDocument, TextDocumentContentChangeEvent change)
focal_class.full_signature: private TextRange getTextRange(TextDocument textDocument, TextDocumentContentChangeEvent change)
focal_class.identifier: getTextRange
focal_class.modifiers: private
focal_class.parameters: (TextDocument textDocument, TextDocumentContentChangeEvent change)
focal_class.return: TextRange
focal_class.signature: TextRange getTextRange(TextDocument textDocument, TextDocumentContentChangeEvent change)
focal_class.class_method_signature: WorkspaceDocumentManagerImpl.setCodeLenses(Path filePath, List<CodeLens> codeLens)
focal_class.full_signature: @Override public void setCodeLenses(Path filePath, List<CodeLens> codeLens)
focal_class.identifier: setCodeLenses
focal_class.modifiers: @Override public
focal_class.parameters: (Path filePath, List<CodeLens> codeLens)
focal_class.return: void
focal_class.signature: void setCodeLenses(Path filePath, List<CodeLens> codeLens)
focal_class.class_method_signature: WorkspaceDocumentManagerImpl.closeFile(Path filePath)
focal_class.full_signature: @Override public void closeFile(Path filePath)
focal_class.identifier: closeFile
focal_class.modifiers: @Override public
focal_class.parameters: (Path filePath)
focal_class.return: void
focal_class.signature: void closeFile(Path filePath)
focal_class.class_method_signature: WorkspaceDocumentManagerImpl.getCodeLenses(Path filePath)
focal_class.full_signature: @Override public List<CodeLens> getCodeLenses(Path filePath)
focal_class.identifier: getCodeLenses
focal_class.modifiers: @Override public
focal_class.parameters: (Path filePath)
focal_class.return: List<CodeLens>
focal_class.signature: List<CodeLens> getCodeLenses(Path filePath)
focal_class.class_method_signature: WorkspaceDocumentManagerImpl.getLSDocument(Path filePath)
focal_class.full_signature: @Override public LSDocumentIdentifier getLSDocument(Path filePath)
focal_class.identifier: getLSDocument
focal_class.modifiers: @Override public
focal_class.parameters: (Path filePath)
focal_class.return: LSDocumentIdentifier
focal_class.signature: LSDocumentIdentifier getLSDocument(Path filePath)
focal_class.class_method_signature: WorkspaceDocumentManagerImpl.getFileContent(Path filePath)
focal_class.full_signature: @Override public String getFileContent(Path filePath)
focal_class.identifier: getFileContent
focal_class.modifiers: @Override public
focal_class.parameters: (Path filePath)
focal_class.return: String
focal_class.signature: String getFileContent(Path filePath)
focal_class.class_method_signature: WorkspaceDocumentManagerImpl.lockFile(Path filePath)
focal_class.full_signature: @Override public Optional<Lock> lockFile(Path filePath)
focal_class.identifier: lockFile
focal_class.modifiers: @Override public
focal_class.parameters: (Path filePath)
focal_class.return: Optional<Lock>
focal_class.signature: Optional<Lock> lockFile(Path filePath)
focal_class.class_method_signature: WorkspaceDocumentManagerImpl.getAllFilePaths()
focal_class.full_signature: @Override public Set<Path> getAllFilePaths()
focal_class.identifier: getAllFilePaths
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Set<Path>
focal_class.signature: Set<Path> getAllFilePaths()
focal_class.class_method_signature: WorkspaceDocumentManagerImpl.clearAllFilePaths()
focal_class.full_signature: @Override public void clearAllFilePaths()
focal_class.identifier: clearAllFilePaths
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void clearAllFilePaths()
focal_class.class_method_signature: WorkspaceDocumentManagerImpl.getTree(Path filePath)
focal_class.full_signature: @Override public SyntaxTree getTree(Path filePath)
focal_class.identifier: getTree
focal_class.modifiers: @Override public
focal_class.parameters: (Path filePath)
focal_class.return: SyntaxTree
focal_class.signature: SyntaxTree getTree(Path filePath)
focal_class.class_method_signature: WorkspaceDocumentManagerImpl.setTree(Path filePath, SyntaxTree newTree)
focal_class.full_signature: @Override public void setTree(Path filePath, SyntaxTree newTree)
focal_class.identifier: setTree
focal_class.modifiers: @Override public
focal_class.parameters: (Path filePath, SyntaxTree newTree)
focal_class.return: void
focal_class.signature: void setTree(Path filePath, SyntaxTree newTree)
focal_class.class_method_signature: WorkspaceDocumentManagerImpl.readFromFileSystem(Path filePath)
focal_class.full_signature: private SyntaxTree readFromFileSystem(Path filePath)
focal_class.identifier: readFromFileSystem
focal_class.modifiers: private
focal_class.parameters: (Path filePath)
focal_class.return: SyntaxTree
focal_class.signature: SyntaxTree readFromFileSystem(Path filePath)
focal_class.class_method_signature: WorkspaceDocumentManagerImpl.rescanProjectRoot(Path filePath)
focal_class.full_signature: private void rescanProjectRoot(Path filePath)
focal_class.identifier: rescanProjectRoot
focal_class.modifiers: private
focal_class.parameters: (Path filePath)
focal_class.return: void
focal_class.signature: void rescanProjectRoot(Path filePath)
focal_method.body: @Override
      public void openFile(Path filePath, String content) throws WorkspaceDocumentException {
          if (isFileOpen(filePath)) {
              throw new WorkspaceDocumentException(
                      "File " + filePath.toString() + " is already opened in document manager."
              );
          }
          documentList.put(filePath, new DocumentPair(new WorkspaceDocument(filePath, content)));
          LSDocumentIdentifier document = new LSDocumentIdentifierImpl(filePath.toUri().toString());
          if (document.isWithinProject()) {
              rescanProjectRoot(filePath);
          }
      }
focal_method.class_method_signature: WorkspaceDocumentManagerImpl.openFile(Path filePath, String content)
focal_method.full_signature: @Override public void openFile(Path filePath, String content)
focal_method.identifier: openFile
focal_method.invocations: isFileOpen toString put toString toUri isWithinProject rescanProjectRoot
focal_method.modifiers: @Override public
focal_method.parameters: (Path filePath, String content)
focal_method.return: void
focal_method.signature: void openFile(Path filePath, String content)