@Test(enabled = false) public void testOpenFile() throws IOException, WorkspaceDocumentException { Optional<Lock> lock = documentManager.lockFile(filePath); try { documentManager.openFile(filePath, readAll(filePath.toFile())); } finally { lock.ifPresent(Lock::unlock); } Path foundPath = documentManager.getAllFilePaths().stream().filter(path -> { try { return Files.isSameFile(path, filePath); } catch (IOException e) { return false; } }).findFirst().orElse(null); Assert.assertNotNull(foundPath); }
@Override public void openFile(Path filePath, String content) throws WorkspaceDocumentException { openOrUpdateFile(filePath, Collections.singletonList(new TextDocumentContentChangeEvent(content))); }
ExtendedWorkspaceDocumentManagerImpl extends WorkspaceDocumentManagerImpl { @Override public void openFile(Path filePath, String content) throws WorkspaceDocumentException { openOrUpdateFile(filePath, Collections.singletonList(new TextDocumentContentChangeEvent(content))); } }
ExtendedWorkspaceDocumentManagerImpl extends WorkspaceDocumentManagerImpl { @Override public void openFile(Path filePath, String content) throws WorkspaceDocumentException { openOrUpdateFile(filePath, Collections.singletonList(new TextDocumentContentChangeEvent(content))); } private  ExtendedWorkspaceDocumentManagerImpl(); }
ExtendedWorkspaceDocumentManagerImpl extends WorkspaceDocumentManagerImpl { @Override public void openFile(Path filePath, String content) throws WorkspaceDocumentException { openOrUpdateFile(filePath, Collections.singletonList(new TextDocumentContentChangeEvent(content))); } private  ExtendedWorkspaceDocumentManagerImpl(); static ExtendedWorkspaceDocumentManagerImpl getInstance(); @Override boolean isFileOpen(Path filePath); @Override void openFile(Path filePath, String content); @Override void updateFile(Path filePath, List<TextDocumentContentChangeEvent> changeEvent); @Override void setCodeLenses(Path filePath, List<CodeLens> codeLens); @Override void closeFile(Path filePath); @Override List<CodeLens> getCodeLenses(Path filePath); @Override String getFileContent(Path filePath); @Override SyntaxTree getTree(Path filePath); @Override void setTree(Path filePath, SyntaxTree newTree); Optional<Lock> enableExplicitMode(Path tempFile); void disableExplicitMode(Lock lock); }
ExtendedWorkspaceDocumentManagerImpl extends WorkspaceDocumentManagerImpl { @Override public void openFile(Path filePath, String content) throws WorkspaceDocumentException { openOrUpdateFile(filePath, Collections.singletonList(new TextDocumentContentChangeEvent(content))); } private  ExtendedWorkspaceDocumentManagerImpl(); static ExtendedWorkspaceDocumentManagerImpl getInstance(); @Override boolean isFileOpen(Path filePath); @Override void openFile(Path filePath, String content); @Override void updateFile(Path filePath, List<TextDocumentContentChangeEvent> changeEvent); @Override void setCodeLenses(Path filePath, List<CodeLens> codeLens); @Override void closeFile(Path filePath); @Override List<CodeLens> getCodeLenses(Path filePath); @Override String getFileContent(Path filePath); @Override SyntaxTree getTree(Path filePath); @Override void setTree(Path filePath, SyntaxTree newTree); Optional<Lock> enableExplicitMode(Path tempFile); void disableExplicitMode(Lock lock);  }