Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 110751 Details for
Bug 243886
Provide a way to disable JS semantic analyzer/validator
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Modified patch + UI changes
bug243886.diff (text/plain), 12.03 KB, created by
Michael Spector
on 2008-08-24 05:50:21 EDT
(
hide
)
Description:
Modified patch + UI changes
Filename:
MIME Type:
Creator:
Michael Spector
Created:
2008-08-24 05:50:21 EDT
Size:
12.03 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.wst.jsdt.ui >Index: src/org/eclipse/wst/jsdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java,v >retrieving revision 1.10 >diff -u -r1.10 ProblemSeveritiesConfigurationBlock.java >--- src/org/eclipse/wst/jsdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java 30 Apr 2008 21:31:52 -0000 1.10 >+++ src/org/eclipse/wst/jsdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java 24 Aug 2008 09:47:17 -0000 >@@ -11,6 +11,7 @@ > package org.eclipse.wst.jsdt.internal.ui.preferences; > > import org.eclipse.core.resources.IProject; >+import org.eclipse.jface.dialogs.ControlEnableState; > import org.eclipse.jface.dialogs.IDialogSettings; > import org.eclipse.swt.SWT; > import org.eclipse.swt.layout.GridData; >@@ -32,6 +33,8 @@ > > private static final String SETTINGS_SECTION_NAME= "ProblemSeveritiesConfigurationBlock"; //$NON-NLS-1$ > >+ private static final Key PREF_PB_ONLY_PARSE_ERRORS = getJDTCoreKey("onlySyntaxErrors"); //$NON-NLS-1$ >+ > // Preference store keys, see JavaScriptCore.getOptions > private static final Key PREF_PB_UNDEFINED_FIELD= getJDTCoreKey(JavaScriptCore.COMPILER_PB_UNDEFINED_FIELD); > // private static final Key PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME= getJDTCoreKey(JavaScriptCore.COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME); >@@ -117,6 +120,9 @@ > > > private PixelConverter fPixelConverter; >+ >+ private ControlEnableState fBlockEnableState; >+ private Composite fControlsComposite; > > public ProblemSeveritiesConfigurationBlock(IStatusChangeListener context, IProject project, IWorkbenchPreferenceContainer container) { > super(context, project, getKeys(), container); >@@ -129,6 +135,7 @@ > > private static Key[] getKeys() { > return new Key[] { >+ PREF_PB_ONLY_PARSE_ERRORS, > PREF_PB_UNDEFINED_FIELD, > /*PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME,*/ PREF_PB_DEPRECATION, PREF_PB_HIDDEN_CATCH_BLOCK, PREF_PB_UNUSED_LOCAL, > PREF_PB_UNUSED_PARAMETER, PREF_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE, >@@ -167,10 +174,15 @@ > layout.marginWidth= 0; > mainComp.setLayout(layout); > >+ String label = PreferencesMessages.ProblemSeveritiesConfigurationBlock_onlySyntaxErrors; >+ addCheckBox(mainComp, label, PREF_PB_ONLY_PARSE_ERRORS, new String[] {"true", "false"}, 0); //$NON-NLS-1$ //$NON-NLS-2$ >+ > Composite commonComposite= createStyleTabContent(mainComp); > GridData gridData= new GridData(GridData.FILL, GridData.FILL, true, true); > gridData.heightHint= fPixelConverter.convertHeightInCharsToPixels(20); > commonComposite.setLayoutData(gridData); >+ >+ fControlsComposite = commonComposite; > > validateSettings(null, null, null); > >@@ -489,7 +501,7 @@ > } > > if (changedKey != null) { >- if (PREF_PB_UNUSED_PARAMETER.equals(changedKey) ) >+ if (PREF_PB_UNUSED_PARAMETER.equals(changedKey) || PREF_PB_ONLY_PARSE_ERRORS.equals(changedKey) ) > // PREF_PB_DEPRECATION.equals(changedKey) || > // PREF_PB_LOCAL_VARIABLE_HIDING.equals(changedKey) || > // PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION.equals(changedKey)) >@@ -508,19 +520,37 @@ > } > > private void updateEnableStates() { >- boolean enableUnusedParams= !checkValue(PREF_PB_UNUSED_PARAMETER, IGNORE); >-// getCheckBox(PREF_PB_SIGNAL_PARAMETER_IN_OVERRIDING).setEnabled(enableUnusedParams); >- getCheckBox(PREF_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE).setEnabled(enableUnusedParams); >- >- boolean enableDeprecation= !checkValue(PREF_PB_DEPRECATION, IGNORE); >- getCheckBox(PREF_PB_DEPRECATION_IN_DEPRECATED_CODE).setEnabled(enableDeprecation); >- getCheckBox(PREF_PB_DEPRECATION_WHEN_OVERRIDING).setEnabled(enableDeprecation); >+ boolean onlyParseErrors = checkValue(PREF_PB_ONLY_PARSE_ERRORS, "true"); //$NON-NLS-1$ >+ enableConfigControls(!onlyParseErrors); > >-// boolean enableThrownExceptions= !checkValue(PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION, IGNORE); >-// getCheckBox(PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING).setEnabled(enableThrownExceptions); >- >-// boolean enableHiding= !checkValue(PREF_PB_LOCAL_VARIABLE_HIDING, IGNORE); >-// getCheckBox(PREF_PB_SPECIAL_PARAMETER_HIDING_FIELD).setEnabled(enableHiding); >+ if (!onlyParseErrors) { >+ boolean enableUnusedParams= !checkValue(PREF_PB_UNUSED_PARAMETER, IGNORE); >+ // getCheckBox(PREF_PB_SIGNAL_PARAMETER_IN_OVERRIDING).setEnabled(enableUnusedParams); >+ getCheckBox(PREF_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE).setEnabled(enableUnusedParams); >+ >+ boolean enableDeprecation= !checkValue(PREF_PB_DEPRECATION, IGNORE); >+ getCheckBox(PREF_PB_DEPRECATION_IN_DEPRECATED_CODE).setEnabled(enableDeprecation); >+ getCheckBox(PREF_PB_DEPRECATION_WHEN_OVERRIDING).setEnabled(enableDeprecation); >+ >+ // boolean enableThrownExceptions= !checkValue(PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION, IGNORE); >+ // getCheckBox(PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING).setEnabled(enableThrownExceptions); >+ >+ // boolean enableHiding= !checkValue(PREF_PB_LOCAL_VARIABLE_HIDING, IGNORE); >+ // getCheckBox(PREF_PB_SPECIAL_PARAMETER_HIDING_FIELD).setEnabled(enableHiding); >+ } >+ } >+ >+ protected void enableConfigControls(boolean enable) { >+ if (enable) { >+ if (fBlockEnableState != null) { >+ fBlockEnableState.restore(); >+ fBlockEnableState= null; >+ } >+ } else { >+ if (fBlockEnableState == null) { >+ fBlockEnableState= ControlEnableState.disable(fControlsComposite); >+ } >+ } > } > > protected String[] getFullBuildDialogStrings(boolean workspaceSettings) { >Index: src/org/eclipse/wst/jsdt/internal/ui/preferences/PreferencesMessages.java >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/PreferencesMessages.java,v >retrieving revision 1.13 >diff -u -r1.13 PreferencesMessages.java >--- src/org/eclipse/wst/jsdt/internal/ui/preferences/PreferencesMessages.java 7 May 2008 21:23:38 -0000 1.13 >+++ src/org/eclipse/wst/jsdt/internal/ui/preferences/PreferencesMessages.java 24 Aug 2008 09:47:16 -0000 >@@ -390,6 +390,7 @@ > public static String ProblemSeveritiesConfigurationBlock_needsfullbuild_message; > public static String ProblemSeveritiesConfigurationBlock_needsprojectbuild_message; > public static String ProblemSeveritiesConfigurationBlock_common_description; >+ public static String ProblemSeveritiesConfigurationBlock_onlySyntaxErrors; > public static String ProblemSeveritiesConfigurationBlock_pb_unsafe_type_op_label; > public static String ProblemSeveritiesConfigurationBlock_pb_raw_type_reference; > public static String ProblemSeveritiesConfigurationBlock_pb_final_param_bound_label; >Index: src/org/eclipse/wst/jsdt/internal/ui/preferences/PreferencesMessages.properties >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/PreferencesMessages.properties,v >retrieving revision 1.18 >diff -u -r1.18 PreferencesMessages.properties >--- src/org/eclipse/wst/jsdt/internal/ui/preferences/PreferencesMessages.properties 7 May 2008 21:23:38 -0000 1.18 >+++ src/org/eclipse/wst/jsdt/internal/ui/preferences/PreferencesMessages.properties 24 Aug 2008 09:47:17 -0000 >@@ -475,6 +475,7 @@ > ProblemSeveritiesConfigurationBlock_pb_missing_deprecated_annotation_label=Missing '@Deprecated' annotation: > ProblemSeveritiesConfigurationBlock_pb_annotation_super_interface_label=Annotation is used as super interface: > ProblemSeveritiesConfigurationBlock_ignore_documented_unused_parameters=Ignore parameters documented with '&@param' tag >+ProblemSeveritiesConfigurationBlock_onlySyntaxErrors=Disable JavaScript se&mantic alanyzer (only show parse errors) > ProblemSeveritiesConfigurationBlock_pb_type_parameter_hiding_label=Type parameter hides another type: > ProblemSeveritiesConfigurationBlock_pb_unused_label_label=Unused 'break' or 'continue' label: > JavadocProblemsPreferencePage_title=Jsdoc Comments >#P org.eclipse.wst.jsdt.core >Index: src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemReporter.java >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemReporter.java,v >retrieving revision 1.26.6.1 >diff -u -r1.26.6.1 ProblemReporter.java >--- src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemReporter.java 19 Jun 2008 20:05:56 -0000 1.26.6.1 >+++ src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemReporter.java 24 Aug 2008 09:47:20 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Michael Spector <spektom@gmail.com> - Bug 243886 > *******************************************************************************/ > package org.eclipse.wst.jsdt.internal.compiler.problem; > >@@ -1115,7 +1116,12 @@ > * to indicate that this problem is configurable through options > */ > public int computeSeverity(int problemID){ >+ > >+ if (this.options.onlyReportSyntaxErrors && (problemID & (IProblem.Syntax | IProblem.Javadoc)) == 0) { >+ return ProblemSeverities.Ignore; >+ } >+ > switch (problemID) { > case IProblem.Task : > return ProblemSeverities.Warning; >Index: src/org/eclipse/wst/jsdt/internal/compiler/impl/CompilerOptions.java >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/impl/CompilerOptions.java,v >retrieving revision 1.11 >diff -u -r1.11 CompilerOptions.java >--- src/org/eclipse/wst/jsdt/internal/compiler/impl/CompilerOptions.java 30 Apr 2008 21:32:36 -0000 1.11 >+++ src/org/eclipse/wst/jsdt/internal/compiler/impl/CompilerOptions.java 24 Aug 2008 09:47:19 -0000 >@@ -357,11 +357,19 @@ > public InferOptions inferOptions=new InferOptions(); > > >+ public boolean onlyReportSyntaxErrors=false; >+ >+ > /** > * Initializing the compiler options with defaults > */ > public CompilerOptions(){ > // use default options >+ try { >+ this.onlyReportSyntaxErrors=JavaScriptCore.getPlugin().getPluginPreferences().getBoolean("onlySyntaxErrors"); >+ } catch (Exception ex) >+ {this.onlyReportSyntaxErrors=false;} >+ > } > > /** >@@ -685,6 +693,11 @@ > > public void set(Map optionsMap) { > >+ try { >+ this.onlyReportSyntaxErrors=JavaScriptCore.getPlugin().getPluginPreferences().getBoolean("onlySyntaxErrors"); >+ } catch (Exception ex) >+ {this.onlyReportSyntaxErrors=false;} >+ > Object optionValue; > if ((optionValue = optionsMap.get(OPTION_LocalVariableAttribute)) != null) { > if (GENERATE.equals(optionValue)) { >Index: src/org/eclipse/wst/jsdt/internal/compiler/Compiler.java >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/Compiler.java,v >retrieving revision 1.16 >diff -u -r1.16 Compiler.java >--- src/org/eclipse/wst/jsdt/internal/compiler/Compiler.java 13 May 2008 22:02:31 -0000 1.16 >+++ src/org/eclipse/wst/jsdt/internal/compiler/Compiler.java 24 Aug 2008 09:47:19 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Michael Spector <spektom@gmail.com> - Bug 243886 > *******************************************************************************/ > package org.eclipse.wst.jsdt.internal.compiler; > >@@ -397,6 +398,9 @@ > CompilationUnitDeclaration unit, > CompilationResult result) { > >+ >+ if (this.options.onlyReportSyntaxErrors) >+ return; > if ((result == null) && (unit != null)) { > result = unit.compilationResult; // current unit being processed ? > } >@@ -461,6 +465,9 @@ > protected void handleInternalException( > AbortCompilation abortException, > CompilationUnitDeclaration unit) { >+ >+ if (this.options.onlyReportSyntaxErrors) >+ return; > > /* special treatment for SilentAbort: silently cancelling the compilation process */ > if (abortException.isSilent) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 243886
:
110584
|
110626
| 110751