|
25 | 25 | import org.eclipse.core.resources.IFile;
|
26 | 26 | import org.eclipse.core.resources.IProject;
|
27 | 27 | import org.eclipse.core.resources.IResource;
|
| 28 | +import org.eclipse.jdt.ui.PreferenceConstants; |
28 | 29 | import org.eclipse.jface.preference.IPreferenceStore;
|
29 | 30 | import org.eclipse.jface.text.BadLocationException;
|
30 | 31 | import org.eclipse.jface.text.DocumentEvent;
|
@@ -158,12 +159,16 @@ public FileLanguageService getLanguageService() {
|
158 | 159 | public void init(IEditorSite site, IEditorInput input) throws PartInitException {
|
159 | 160 | super.init(site, input);
|
160 | 161 |
|
| 162 | + this.characterPairMatcher = createCharacterPairMatcher(); |
| 163 | + |
161 | 164 | if (input instanceof IPathEditorInput) {
|
162 | 165 | IResource resource = ResourceUtil.getResource(input);
|
163 | 166 | IProject project = resource.getProject();
|
164 | 167 |
|
165 | 168 | // set a project-specific preference store
|
166 | 169 | ChainedPreferenceStore chainedPreferenceStore = new ChainedPreferenceStore(new IPreferenceStore[] {
|
| 170 | + PreferenceConstants.getPreferenceStore(), |
| 171 | + TypeScriptPlugin.getDefault().getPreferenceStore(), |
167 | 172 | new ProjectPreferenceStore(project),
|
168 | 173 | EditorsUI.getPreferenceStore(),
|
169 | 174 | PlatformUI.getPreferenceStore()
|
@@ -223,11 +228,11 @@ public void selectAndReveal(int offset, int length, String name) {
|
223 | 228 |
|
224 | 229 | @Override
|
225 | 230 | protected void configureSourceViewerDecorationSupport(SourceViewerDecorationSupport support) {
|
226 |
| - super.configureSourceViewerDecorationSupport(support); |
227 |
| - |
228 | 231 | support.setCharacterPairMatcher(this.characterPairMatcher);
|
229 | 232 | support.setMatchingCharacterPainterPreferenceKeys(IPreferenceConstants.EDITOR_MATCHING_BRACKETS,
|
230 | 233 | IPreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR);
|
| 234 | + |
| 235 | + super.configureSourceViewerDecorationSupport(support); |
231 | 236 | }
|
232 | 237 |
|
233 | 238 | @Override
|
@@ -288,21 +293,6 @@ protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler rule
|
288 | 293 | return sourceViewer;
|
289 | 294 | }
|
290 | 295 |
|
291 |
| - @Override |
292 |
| - protected void initializeEditor() { |
293 |
| - super.initializeEditor(); |
294 |
| - |
295 |
| - this.characterPairMatcher = createCharacterPairMatcher(); |
296 |
| - |
297 |
| - // set the preference store |
298 |
| - ChainedPreferenceStore chainedPreferenceStore = new ChainedPreferenceStore(new IPreferenceStore[] { |
299 |
| - TypeScriptPlugin.getDefault().getPreferenceStore(), |
300 |
| - EditorsUI.getPreferenceStore(), |
301 |
| - PlatformUI.getPreferenceStore() |
302 |
| - }); |
303 |
| - this.setPreferenceStore(chainedPreferenceStore); |
304 |
| - } |
305 |
| - |
306 | 296 | @Override
|
307 | 297 | protected void initializeKeyBindingScopes() {
|
308 | 298 | this.setKeyBindingScopes(new String[] {
|
|
0 commit comments