Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1705)

Unified Diff: pkg/analysis_server/lib/src/analysis_server.dart

Issue 362893004: Implementation for 'analysis.getHover'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/computer/computer_hover.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/analysis_server.dart
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index d608c6ad2bb6dff33c52a4d64d2fef936e40ddfb..d5ddcdffdb15eefcdb80f98a5ffbc03e372a989b 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -226,7 +226,7 @@ class AnalysisServer {
new HashMap<AnalysisContext, List<Source>>();
List<String> unanalyzed = new List<String>();
files.forEach((file) {
- AnalysisContext analysisContext = _getAnalysisContext(file);
+ AnalysisContext analysisContext = getAnalysisContext(file);
if (analysisContext == null) {
unanalyzed.add(file);
} else {
@@ -235,7 +235,7 @@ class AnalysisServer {
sourceList = <Source>[];
sourceMap[analysisContext] = sourceList;
}
- sourceList.add(_getSource(file));
+ sourceList.add(getSource(file));
}
});
if (unanalyzed.isNotEmpty) {
@@ -434,13 +434,13 @@ class AnalysisServer {
*/
void updateContent(Map<String, ContentChange> changes) {
changes.forEach((file, change) {
- AnalysisContext analysisContext = _getAnalysisContext(file);
+ AnalysisContext analysisContext = getAnalysisContext(file);
// TODO(paulberry): handle the case where a file is referred to by more
// than one context (e.g package A depends on package B using a local
// path, user has both packages open for editing in separate contexts,
// and user modifies a file in package B).
if (analysisContext != null) {
- Source source = _getSource(file);
+ Source source = getSource(file);
if (change.offset == null) {
analysisContext.setContents(source, change.content);
} else {
@@ -461,8 +461,8 @@ class AnalysisServer {
Set<String> oldFiles = analysisServices[service];
Set<String> todoFiles = oldFiles != null ? newFiles.difference(oldFiles) : newFiles;
for (String file in todoFiles) {
- Source source = _getSource(file);
- AnalysisContext context = _getAnalysisContext(file);
+ Source source = getSource(file);
+ AnalysisContext context = getAnalysisContext(file);
// errors
if (service == AnalysisService.ERRORS) {
LineInfo lineInfo = context.getLineInfo(source);
@@ -497,7 +497,7 @@ class AnalysisServer {
* Return the [AnalysisContext] that is used to analyze the given [path].
* Return `null` if there is no such context.
*/
- AnalysisContext _getAnalysisContext(String path) {
+ AnalysisContext getAnalysisContext(String path) {
for (Folder folder in folderMap.keys) {
if (path.startsWith(folder.path)) {
return folderMap[folder];
@@ -509,7 +509,7 @@ class AnalysisServer {
/**
* Return the [Source] of the Dart file with the given [path].
*/
- Source _getSource(String path) {
+ Source getSource(String path) {
File file = contextDirectoryManager.resourceProvider.getResource(path);
return file.createSource(UriKind.FILE_URI);
}
@@ -522,12 +522,12 @@ class AnalysisServer {
*/
CompilationUnit getResolvedCompilationUnitToResendNotification(String path) {
// prepare AnalysisContext
- AnalysisContext context = _getAnalysisContext(path);
+ AnalysisContext context = getAnalysisContext(path);
if (context == null) {
return null;
}
// prepare sources
- Source unitSource = _getSource(path);
+ Source unitSource = getSource(path);
List<Source> librarySources = context.getLibrariesContaining(unitSource);
if (librarySources.isEmpty) {
return null;
@@ -547,12 +547,12 @@ class AnalysisServer {
*/
CompilationUnit test_getResolvedCompilationUnit(String path) {
// prepare AnalysisContext
- AnalysisContext context = _getAnalysisContext(path);
+ AnalysisContext context = getAnalysisContext(path);
if (context == null) {
return null;
}
// prepare sources
- Source unitSource = _getSource(path);
+ Source unitSource = getSource(path);
List<Source> librarySources = context.getLibrariesContaining(unitSource);
if (librarySources.isEmpty) {
return null;
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/computer/computer_hover.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698