use of org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration in project che by eclipse.
the class FindDefinitionAction method updateInPerspective.
@Override
public void updateInPerspective(@NotNull ActionEvent event) {
EditorPartPresenter activeEditor = editorAgent.getActiveEditor();
if (activeEditor instanceof TextEditor) {
TextEditorConfiguration configuration = ((TextEditor) activeEditor).getConfiguration();
if (configuration instanceof LanguageServerEditorConfiguration) {
ServerCapabilities capabilities = ((LanguageServerEditorConfiguration) configuration).getServerCapabilities();
event.getPresentation().setEnabledAndVisible(capabilities.isDefinitionProvider() != null && capabilities.isDefinitionProvider());
return;
}
}
event.getPresentation().setEnabledAndVisible(false);
}
use of org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration in project che by eclipse.
the class FindReferencesAction method updateInPerspective.
@Override
public void updateInPerspective(@NotNull ActionEvent event) {
EditorPartPresenter activeEditor = editorAgent.getActiveEditor();
if (activeEditor instanceof TextEditor) {
TextEditorConfiguration configuration = ((TextEditor) activeEditor).getConfiguration();
if (configuration instanceof LanguageServerEditorConfiguration) {
ServerCapabilities capabilities = ((LanguageServerEditorConfiguration) configuration).getServerCapabilities();
event.getPresentation().setEnabledAndVisible(capabilities.isReferencesProvider() != null && capabilities.isReferencesProvider());
return;
}
}
event.getPresentation().setEnabledAndVisible(false);
}
use of org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration in project che by eclipse.
the class PublishDiagnosticsProcessor method processDiagnostics.
public void processDiagnostics(PublishDiagnosticsParamsDTO diagnosticsMessage) {
EditorPartPresenter openedEditor = editorAgent.getOpenedEditor(new Path(diagnosticsMessage.getUri()));
//TODO add markers
if (openedEditor == null) {
return;
}
if (openedEditor instanceof TextEditor) {
TextEditorConfiguration editorConfiguration = ((TextEditor) openedEditor).getConfiguration();
AnnotationModel annotationModel = editorConfiguration.getAnnotationModel();
if (annotationModel != null && annotationModel instanceof DiagnosticCollector) {
DiagnosticCollector collector = (DiagnosticCollector) annotationModel;
collector.beginReporting();
try {
for (DiagnosticDTO diagnostic : diagnosticsMessage.getDiagnostics()) {
collector.acceptDiagnostic(diagnostic);
}
} finally {
collector.endReporting();
}
}
}
}
use of org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration in project che by eclipse.
the class JsJavaEditorProvider method getEditor.
@Override
public TextEditor getEditor() {
LOG.fine("JsJavaEditor instance creation.");
final TextEditor textEditor = super.getEditor();
if (textEditor instanceof OrionEditorPresenter) {
final OrionEditorPresenter editor = (OrionEditorPresenter) textEditor;
final TextEditorConfiguration configuration = configurationFactory.create(editor);
editor.initialize(configuration);
editor.addEditorUpdateAction(new EditorUpdateAction() {
@Override
public void doRefresh() {
final Reconciler reconciler = configuration.getReconciler();
if (reconciler != null) {
final ReconcilingStrategy strategy = reconciler.getReconcilingStrategy(DEFAULT_CONTENT_TYPE);
if (strategy instanceof JavaReconcilerStrategy) {
((JavaReconcilerStrategy) strategy).parse();
}
}
}
});
}
watcher.editorOpened(textEditor);
return textEditor;
}
use of org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration in project che by eclipse.
the class GoToSymbolAction method updateInPerspective.
@Override
public void updateInPerspective(@NotNull ActionEvent event) {
EditorPartPresenter activeEditor = editorAgent.getActiveEditor();
if (activeEditor instanceof TextEditor) {
TextEditorConfiguration configuration = ((TextEditor) activeEditor).getConfiguration();
if (configuration instanceof LanguageServerEditorConfiguration) {
ServerCapabilities capabilities = ((LanguageServerEditorConfiguration) configuration).getServerCapabilities();
event.getPresentation().setEnabledAndVisible(capabilities.isDocumentSymbolProvider() != null && capabilities.isDocumentSymbolProvider());
return;
}
}
event.getPresentation().setEnabledAndVisible(false);
}
Aggregations