1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 02:06:01 +02:00

Remove non-functioning Qt plug-ins

Fixes #123
This commit is contained in:
Jonah Graham 2022-10-28 16:51:05 -04:00
parent 10e95a1825
commit 75c779fc1d
414 changed files with 24 additions and 54247 deletions

View file

@ -10,6 +10,13 @@ This is the New & Noteworthy page for CDT 11.0 which is part of Eclipse 2022-12
Jave 17 is now required to build and run Eclipse CDT. See https://github.com/eclipse-cdt/cdt/issues/80 Jave 17 is now required to build and run Eclipse CDT. See https://github.com/eclipse-cdt/cdt/issues/80
## Removed plug-ins and features
Various plug-ins and features are no longer part of the CDT release.
Please see the corresponding issue for more details.
- Qt plug-ins (`org.eclipse.cdt.qt.ui/core/feature`) https://github.com/eclipse-cdt/cdt/issues/123 _Note:_ the `org.eclipse.cdt.testsrunner.qttest` plug-in is still part of CDT.
# Debug # Debug
## C/C++ Dynamic Printf Breakpoints ## C/C++ Dynamic Printf Breakpoints
@ -27,7 +34,7 @@ See [Bug 580873](https://bugs.eclipse.org/bugs/show_bug.cgi?id=580873).
Please see [CHANGELOG-API](CHANGELOG-API.md) for details on the breaking API changes in this release as well as future planned API changes. Please see [CHANGELOG-API](CHANGELOG-API.md) for details on the breaking API changes in this release as well as future planned API changes.
## New Job Family for backgrond build settings update ## New Job Family for background build settings update
When the project is modified the managed build settings needs to update settings. When the project is modified the managed build settings needs to update settings.

View file

@ -13,6 +13,7 @@ This section describes API removals that occurred in past releases, and upcoming
- [Removal of deprecated CommandLauncher.execute() method](#executeCommandLauncher) - [Removal of deprecated CommandLauncher.execute() method](#executeCommandLauncher)
- [Removal of deprecated CBuildConfiguration.watchProcess() methods](#watchProcessCBuildConfig) - [Removal of deprecated CBuildConfiguration.watchProcess() methods](#watchProcessCBuildConfig)
- [Rework of API to determine GDB command line in org.eclipse.cdt.dsf.gdb](#gdbBackendDebuggerCommandLine) - [Rework of API to determine GDB command line in org.eclipse.cdt.dsf.gdb](#gdbBackendDebuggerCommandLine)
- [Removal of Qt plug-ins and features](#qt-plugins)
## API Changes in CDT 10.5.0 ## API Changes in CDT 10.5.0
@ -150,6 +151,18 @@ instead.
See [Bug 572944](https://bugs.eclipse.org/bugs/show_bug.cgi?id=572944) See [Bug 572944](https://bugs.eclipse.org/bugs/show_bug.cgi?id=572944)
and https://github.com/eclipse-cdt/cdt/pull/112. and https://github.com/eclipse-cdt/cdt/pull/112.
### <span id="qt-plugins">Removal of Qt plug-ins and features</span>
For a while now the Qt plug-ins have had at least some issues.
They rely on the Nashorn script engine which was removed in Java 15.
The plug-ins have been removed in CDT 11.
The following bundles and all their related API has been removed:
- org.eclipse.cdt.qt.ui
- org.eclipse.cdt.qt.core
See https://github.com/eclipse-cdt/cdt/issues/123
--- ---
## API Changes in CDT 10.5.0. ## API Changes in CDT 10.5.0.

View file

@ -40,7 +40,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
&lt;process type="org.eclipse.cdt.managedbuilder.core.AddLanguageSettingsProvider"> &lt;process type="org.eclipse.cdt.managedbuilder.core.AddLanguageSettingsProvider">
&lt;simple name="projectName" value="$(projectName)"/> &lt;simple name="projectName" value="$(projectName)"/>
&lt;simple-array name="languageSettingsProviders"> &lt;simple-array name="languageSettingsProviders">
&lt;element value="org.eclipse.cdt.qt.core.QtPathsProvider"/> &lt;element value="com.yourcompany.core.YourPathsProvider"/>
&lt;/simple-array> &lt;/simple-array>
&lt;/process> &lt;/process>
* </pre> * </pre>

10
pom.xml
View file

@ -216,10 +216,6 @@
<module>native/org.eclipse.cdt.native.serial</module> <module>native/org.eclipse.cdt.native.serial</module>
<module>qt/org.eclipse.cdt.qt.core</module>
<module>qt/org.eclipse.cdt.qt.ui</module>
<module>qt/org.eclipse.cdt.qt-feature</module>
<module>remote/org.eclipse.cdt.remote.core</module> <module>remote/org.eclipse.cdt.remote.core</module>
<module>testsrunner/org.eclipse.cdt.testsrunner</module> <module>testsrunner/org.eclipse.cdt.testsrunner</module>
@ -322,7 +318,6 @@
<module>lsp/org.eclipse.cdt.lsp.core.tests</module> <module>lsp/org.eclipse.cdt.lsp.core.tests</module>
<module>lsp/org.eclipse.cdt.lsp.cquery.tests</module> <module>lsp/org.eclipse.cdt.lsp.cquery.tests</module>
<module>memory/org.eclipse.cdt.debug.core.memory.tests</module> <module>memory/org.eclipse.cdt.debug.core.memory.tests</module>
<module>qt/org.eclipse.cdt.qt.ui.tests</module>
<module>testsrunner/org.eclipse.cdt.testsrunner.tests</module> <module>testsrunner/org.eclipse.cdt.testsrunner.tests</module>
<module>releng/org.eclipse.cdt.testing</module> <module>releng/org.eclipse.cdt.testing</module>
@ -332,10 +327,7 @@
<!-- TODO: Investigate/Fix hanging before re-enable re-enabling <!-- TODO: Investigate/Fix hanging before re-enable re-enabling
<module>debug/org.eclipse.cdt.debug.application.tests</module> <module>debug/org.eclipse.cdt.debug.application.tests</module>
--> -->
<!--
<module>qt/org.eclipse.cdt.qt.core.tests</module>
-->
</modules> </modules>
<pluginRepositories> <pluginRepositories>

View file

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.cdt.qt-feature</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
</projectDescription>

View file

@ -1,2 +0,0 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8

View file

@ -1,2 +0,0 @@
bin.includes = feature.xml,\
feature.properties

View file

@ -1,37 +0,0 @@
###############################################################################
# Copyright (c) 2008, 2010 Wind River Systems
#
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Wind River Systems - initial implementation
# IBM Corporation
###############################################################################
# features.properties
# contains externalized strings for feature.xml
# "%foo" in feature.xml corresponds to the key "foo" in this file
# java.io.Properties file (ISO 8859-1 with "\" escapes)
# This file should be translated.
# "featureName" property - name of the feature
featureName=C/C++ Qt Support - Preview
# "providerName" property - name of the company that provides the feature
providerName=Eclipse CDT
# "description" property - description of the feature
description=Support for Qt projects and objects in the indexer.
# copyright
copyright=\
Copyright (c) 2013 QNX Software Systems and others.\n\
This program and the accompanying materials\n\
are made available under the terms of the Eclipse Public License 2.0\n\
which accompanies this distribution, and is available at\n\
https://www.eclipse.org/legal/epl-2.0/

View file

@ -1,51 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2013, 2021 Contributors to the Eclipse Foundation
This program and the accompanying materials
are made available under the terms of the Eclipse Public License 2.0
which accompanies this distribution, and is available at
https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
-->
<feature
id="org.eclipse.cdt.qt"
label="%featureName"
version="11.0.0.qualifier"
provider-name="%providerName"
plugin="org.eclipse.cdt.qt.ui"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
<description>
%description
</description>
<copyright>
%copyright
</copyright>
<license url="%licenseURL">
%license
</license>
<requires>
<import feature="org.eclipse.launchbar" version="11.0.0" match="compatible"/>
</requires>
<plugin
id="org.eclipse.cdt.qt.core"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.cdt.qt.ui"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src">
<attributes>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.cdt.qt.core.tests</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -1,2 +0,0 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8

View file

@ -1,486 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
org.eclipse.jdt.core.builder.invalidClasspath=abort
org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch, *.xtend
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.mainOnlyProjectHasTestOnlyDependency=error
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error
org.eclipse.jdt.core.codeComplete.argumentPrefixes=
org.eclipse.jdt.core.codeComplete.argumentSuffixes=
org.eclipse.jdt.core.codeComplete.fieldPrefixes=
org.eclipse.jdt.core.codeComplete.fieldSuffixes=
org.eclipse.jdt.core.codeComplete.localPrefixes=
org.eclipse.jdt.core.codeComplete.localSuffixes=
org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=ignore
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=error
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false
org.eclipse.jdt.core.formatter.align_with_spaces=false
org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0
org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_module_statements=16
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0
org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true
org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true
org.eclipse.jdt.core.formatter.comment.format_block_comments=false
org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=true
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
org.eclipse.jdt.core.formatter.comment.format_line_comments=false
org.eclipse.jdt.core.formatter.comment.format_source_code=true
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
org.eclipse.jdt.core.formatter.comment.indent_root_tags=false
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
org.eclipse.jdt.core.formatter.comment.line_length=80
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
org.eclipse.jdt.core.formatter.compact_else_if=true
org.eclipse.jdt.core.formatter.continuation_indentation=2
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_empty_lines=false
org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=4
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.join_lines_in_comments=true
org.eclipse.jdt.core.formatter.join_wrapped_lines=true
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false
org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false
org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.jdt.core.formatter.lineSplit=120
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=4
org.eclipse.jdt.core.formatter.use_on_off_tags=true
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false
org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true
org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
org.eclipse.jdt.core.incompleteClasspath=error
org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter

View file

@ -1,3 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.launching.PREF_COMPILER_COMPLIANCE_DOES_NOT_MATCH_JRE=warning
org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning

View file

@ -1,213 +0,0 @@
cleanup.add_all=false
cleanup.add_default_serial_version_id=true
cleanup.add_generated_serial_version_id=false
cleanup.add_missing_annotations=true
cleanup.add_missing_deprecated_annotations=true
cleanup.add_missing_methods=false
cleanup.add_missing_nls_tags=false
cleanup.add_missing_override_annotations=true
cleanup.add_missing_override_annotations_interface_methods=true
cleanup.add_serial_version_id=false
cleanup.always_use_blocks=true
cleanup.always_use_parentheses_in_expressions=false
cleanup.always_use_this_for_non_static_field_access=false
cleanup.always_use_this_for_non_static_method_access=false
cleanup.array_with_curly=false
cleanup.arrays_fill=false
cleanup.bitwise_conditional_expression=false
cleanup.boolean_literal=false
cleanup.boolean_value_rather_than_comparison=false
cleanup.break_loop=false
cleanup.collection_cloning=false
cleanup.comparing_on_criteria=false
cleanup.comparison_statement=false
cleanup.controlflow_merge=false
cleanup.convert_functional_interfaces=false
cleanup.convert_to_enhanced_for_loop=false
cleanup.convert_to_enhanced_for_loop_if_loop_var_used=true
cleanup.convert_to_switch_expressions=false
cleanup.correct_indentation=false
cleanup.do_while_rather_than_while=true
cleanup.double_negation=false
cleanup.else_if=false
cleanup.embedded_if=false
cleanup.evaluate_nullable=false
cleanup.extract_increment=false
cleanup.format_source_code=true
cleanup.format_source_code_changes_only=false
cleanup.hash=false
cleanup.if_condition=false
cleanup.insert_inferred_type_arguments=false
cleanup.instanceof=false
cleanup.instanceof_keyword=false
cleanup.invert_equals=false
cleanup.join=false
cleanup.lazy_logical_operator=false
cleanup.make_local_variable_final=true
cleanup.make_parameters_final=false
cleanup.make_private_fields_final=true
cleanup.make_type_abstract_if_missing_method=false
cleanup.make_variable_declarations_final=false
cleanup.map_cloning=false
cleanup.merge_conditional_blocks=false
cleanup.multi_catch=false
cleanup.never_use_blocks=false
cleanup.never_use_parentheses_in_expressions=true
cleanup.no_string_creation=false
cleanup.no_super=false
cleanup.number_suffix=false
cleanup.objects_equals=false
cleanup.one_if_rather_than_duplicate_blocks_that_fall_through=false
cleanup.operand_factorization=false
cleanup.organize_imports=true
cleanup.overridden_assignment=false
cleanup.plain_replacement=false
cleanup.precompile_regex=false
cleanup.primitive_comparison=false
cleanup.primitive_parsing=false
cleanup.primitive_rather_than_wrapper=false
cleanup.primitive_serialization=false
cleanup.pull_out_if_from_if_else=false
cleanup.pull_up_assignment=false
cleanup.push_down_negation=false
cleanup.qualify_static_field_accesses_with_declaring_class=false
cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
cleanup.qualify_static_member_accesses_with_declaring_class=false
cleanup.qualify_static_method_accesses_with_declaring_class=false
cleanup.reduce_indentation=false
cleanup.redundant_comparator=false
cleanup.redundant_falling_through_block_end=false
cleanup.remove_private_constructors=true
cleanup.remove_redundant_modifiers=false
cleanup.remove_redundant_semicolons=true
cleanup.remove_redundant_type_arguments=true
cleanup.remove_trailing_whitespaces=true
cleanup.remove_trailing_whitespaces_all=true
cleanup.remove_trailing_whitespaces_ignore_empty=false
cleanup.remove_unnecessary_array_creation=false
cleanup.remove_unnecessary_casts=true
cleanup.remove_unnecessary_nls_tags=false
cleanup.remove_unused_imports=true
cleanup.remove_unused_local_variables=false
cleanup.remove_unused_method_parameters=false
cleanup.remove_unused_private_fields=true
cleanup.remove_unused_private_members=false
cleanup.remove_unused_private_methods=true
cleanup.remove_unused_private_types=true
cleanup.return_expression=false
cleanup.simplify_lambda_expression_and_method_ref=false
cleanup.single_used_field=false
cleanup.sort_members=false
cleanup.sort_members_all=false
cleanup.standard_comparison=false
cleanup.static_inner_class=false
cleanup.strictly_equal_or_different=false
cleanup.stringbuffer_to_stringbuilder=false
cleanup.stringbuilder=false
cleanup.stringbuilder_for_local_vars=true
cleanup.stringconcat_to_textblock=false
cleanup.substring=false
cleanup.switch=false
cleanup.system_property=false
cleanup.system_property_boolean=false
cleanup.system_property_file_encoding=false
cleanup.system_property_file_separator=false
cleanup.system_property_line_separator=false
cleanup.system_property_path_separator=false
cleanup.ternary_operator=false
cleanup.try_with_resource=false
cleanup.unlooped_while=false
cleanup.unreachable_block=false
cleanup.use_anonymous_class_creation=false
cleanup.use_autoboxing=false
cleanup.use_blocks=false
cleanup.use_blocks_only_for_return_and_throw=false
cleanup.use_directly_map_method=false
cleanup.use_lambda=true
cleanup.use_parentheses_in_expressions=false
cleanup.use_string_is_blank=false
cleanup.use_this_for_non_static_field_access=false
cleanup.use_this_for_non_static_field_access_only_if_necessary=true
cleanup.use_this_for_non_static_method_access=false
cleanup.use_this_for_non_static_method_access_only_if_necessary=true
cleanup.use_unboxing=false
cleanup.use_var=false
cleanup.useless_continue=false
cleanup.useless_return=false
cleanup.valueof_rather_than_instantiation=false
cleanup_profile=_CDT
cleanup_settings_version=2
eclipse.preferences.version=1
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
formatter_profile=_CDT
formatter_settings_version=14
internal.default.compliance=user
org.eclipse.jdt.ui.exception.name=e
org.eclipse.jdt.ui.gettersetter.use.is=true
org.eclipse.jdt.ui.ignorelowercasenames=true
org.eclipse.jdt.ui.importorder=java;javax;org;com;
org.eclipse.jdt.ui.keywordthis=false
org.eclipse.jdt.ui.ondemandthreshold=1000
org.eclipse.jdt.ui.overrideannotation=true
org.eclipse.jdt.ui.staticondemandthreshold=1000
org.eclipse.jdt.ui.text.custom_code_templates=
sp_cleanup.add_default_serial_version_id=true
sp_cleanup.add_generated_serial_version_id=false
sp_cleanup.add_missing_annotations=true
sp_cleanup.add_missing_deprecated_annotations=true
sp_cleanup.add_missing_methods=false
sp_cleanup.add_missing_nls_tags=false
sp_cleanup.add_missing_override_annotations=true
sp_cleanup.add_missing_override_annotations_interface_methods=true
sp_cleanup.add_serial_version_id=false
sp_cleanup.always_use_blocks=true
sp_cleanup.always_use_parentheses_in_expressions=false
sp_cleanup.always_use_this_for_non_static_field_access=false
sp_cleanup.always_use_this_for_non_static_method_access=false
sp_cleanup.convert_functional_interfaces=false
sp_cleanup.convert_to_enhanced_for_loop=false
sp_cleanup.correct_indentation=false
sp_cleanup.format_source_code=true
sp_cleanup.format_source_code_changes_only=false
sp_cleanup.insert_inferred_type_arguments=false
sp_cleanup.make_local_variable_final=true
sp_cleanup.make_parameters_final=false
sp_cleanup.make_private_fields_final=true
sp_cleanup.make_type_abstract_if_missing_method=false
sp_cleanup.make_variable_declarations_final=false
sp_cleanup.never_use_blocks=false
sp_cleanup.never_use_parentheses_in_expressions=true
sp_cleanup.on_save_use_additional_actions=true
sp_cleanup.organize_imports=true
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
sp_cleanup.remove_private_constructors=true
sp_cleanup.remove_redundant_modifiers=false
sp_cleanup.remove_redundant_semicolons=true
sp_cleanup.remove_redundant_type_arguments=true
sp_cleanup.remove_trailing_whitespaces=true
sp_cleanup.remove_trailing_whitespaces_all=true
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
sp_cleanup.remove_unnecessary_casts=true
sp_cleanup.remove_unnecessary_nls_tags=false
sp_cleanup.remove_unused_imports=true
sp_cleanup.remove_unused_local_variables=false
sp_cleanup.remove_unused_private_fields=true
sp_cleanup.remove_unused_private_members=false
sp_cleanup.remove_unused_private_methods=true
sp_cleanup.remove_unused_private_types=true
sp_cleanup.sort_members=false
sp_cleanup.sort_members_all=false
sp_cleanup.use_anonymous_class_creation=false
sp_cleanup.use_blocks=false
sp_cleanup.use_blocks_only_for_return_and_throw=false
sp_cleanup.use_lambda=true
sp_cleanup.use_parentheses_in_expressions=false
sp_cleanup.use_this_for_non_static_field_access=false
sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
sp_cleanup.use_this_for_non_static_method_access=false
sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true

View file

@ -1,184 +0,0 @@
ANNOTATION_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
ANNOTATION_ELEMENT_TYPE_ADDED_FIELD=Error
ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error
ANNOTATION_ELEMENT_TYPE_ADDED_METHOD=Error
ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error
ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
ANNOTATION_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
ANNOTATION_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error
ANNOTATION_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error
ANNOTATION_ELEMENT_TYPE_CHANGED_TO_CLASS=Error
ANNOTATION_ELEMENT_TYPE_CHANGED_TO_ENUM=Error
ANNOTATION_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error
ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
ANNOTATION_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
ANNOTATION_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITHOUT_DEFAULT_VALUE=Error
ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITH_DEFAULT_VALUE=Error
ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error
API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
API_USE_SCAN_FIELD_SEVERITY=Error
API_USE_SCAN_METHOD_SEVERITY=Error
API_USE_SCAN_TYPE_SEVERITY=Error
CLASS_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
CLASS_ELEMENT_TYPE_ADDED_FIELD=Error
CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error
CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
CLASS_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERCLASS_SET=Error
CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
CLASS_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
CLASS_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error
CLASS_ELEMENT_TYPE_CHANGED_SUPERCLASS=Error
CLASS_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error
CLASS_ELEMENT_TYPE_CHANGED_TO_ENUM=Error
CLASS_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error
CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
CLASS_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error
CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error
CONSTRUCTOR_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error
CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
CONSTRUCTOR_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
CONSTRUCTOR_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
CONSTRUCTOR_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
CONSTRUCTOR_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error
CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
CONSTRUCTOR_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
CONSTRUCTOR_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error
CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error
ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
ENUM_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error
ENUM_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error
ENUM_ELEMENT_TYPE_CHANGED_TO_CLASS=Error
ENUM_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error
ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENTS=Error
FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
ILLEGAL_EXTEND=Warning
ILLEGAL_IMPLEMENT=Warning
ILLEGAL_INSTANTIATE=Warning
ILLEGAL_OVERRIDE=Warning
ILLEGAL_REFERENCE=Warning
INTERFACE_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
INTERFACE_ELEMENT_TYPE_ADDED_DEFAULT_METHOD=Error
INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error
INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
INTERFACE_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error
INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETERS=Error
INTERFACE_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error
INTERFACE_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error
INTERFACE_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error
INTERFACE_ELEMENT_TYPE_CHANGED_TO_CLASS=Error
INTERFACE_ELEMENT_TYPE_CHANGED_TO_ENUM=Error
INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
INTERFACE_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error
INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
INVALID_ANNOTATION=Ignore
INVALID_JAVADOC_TAG=Error
INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning
LEAK_EXTEND=Warning
LEAK_FIELD_DECL=Warning
LEAK_IMPLEMENT=Warning
LEAK_METHOD_PARAM=Warning
LEAK_METHOD_RETURN_TYPE=Warning
METHOD_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error
METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
METHOD_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
METHOD_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
METHOD_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error
METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
METHOD_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error
METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error
MISSING_EE_DESCRIPTIONS=Warning
TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
UNUSED_PROBLEM_FILTERS=Warning
automatically_removed_unused_problem_filters=false
changed_execution_env=Error
eclipse.preferences.version=1
incompatible_api_component_version=Error
incompatible_api_component_version_include_major_without_breaking_change=Disabled
incompatible_api_component_version_include_minor_without_api_change=Disabled
incompatible_api_component_version_report_major_without_breaking_change=Warning
incompatible_api_component_version_report_minor_without_api_change=Warning
invalid_since_tag_version=Error
malformed_since_tag=Error
missing_since_tag=Error
report_api_breakage_when_major_version_incremented=Disabled
report_resolution_errors_api_component=Warning

View file

@ -1,35 +0,0 @@
compilers.f.unresolved-features=1
compilers.f.unresolved-plugins=1
compilers.incompatible-environment=1
compilers.p.build=1
compilers.p.build.bin.includes=1
compilers.p.build.encodings=2
compilers.p.build.java.compiler=2
compilers.p.build.java.compliance=1
compilers.p.build.missing.output=2
compilers.p.build.output.library=1
compilers.p.build.source.library=1
compilers.p.build.src.includes=1
compilers.p.deprecated=1
compilers.p.discouraged-class=1
compilers.p.internal=1
compilers.p.missing-packages=2
compilers.p.missing-version-export-package=2
compilers.p.missing-version-import-package=2
compilers.p.missing-version-require-bundle=2
compilers.p.no-required-att=0
compilers.p.no.automatic.module=1
compilers.p.not-externalized-att=2
compilers.p.service.component.without.lazyactivation=1
compilers.p.unknown-attribute=1
compilers.p.unknown-class=1
compilers.p.unknown-element=1
compilers.p.unknown-identifier=1
compilers.p.unknown-resource=1
compilers.p.unresolved-ex-points=0
compilers.p.unresolved-import=0
compilers.s.create-docs=false
compilers.s.doc-folder=doc
compilers.s.open-tags=1
compilers.use-project=true
eclipse.preferences.version=1

View file

@ -1,15 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.qt.core.tests
Bundle-Vendor: %providerName
Bundle-Version: 2.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-17
Require-Bundle: org.eclipse.osgi;bundle-version="3.10.100",
org.junit,
org.eclipse.cdt.qt.core;bundle-version="2.0.0"
Bundle-ClassPath: .
Bundle-Activator: org.eclipse.cdt.qt.core.tests.Activator
Bundle-ActivationPolicy: lazy
Automatic-Module-Name: org.eclipse.cdt.qt.core.tests
Bundle-Localization: plugin

View file

@ -1,38 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>About</title>
</head>
<body lang="EN-US">
<h2>About This Content</h2>
<p>November 30, 2017</p>
<h3>License</h3>
<p>
The Eclipse Foundation makes available all content in this plug-in
(&quot;Content&quot;). Unless otherwise indicated below, the Content
is provided to you under the terms and conditions of the Eclipse
Public License Version 2.0 (&quot;EPL&quot;). A copy of the EPL is
available at <a href="https://www.eclipse.org/legal/epl-2.0">https://www.eclipse.org/legal/epl-2.0</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.
</p>
<p>
If you did not receive this Content directly from the Eclipse
Foundation, the Content is being redistributed by another party
(&quot;Redistributor&quot;) and different terms and conditions may
apply to your use of any object code in the Content. Check the
Redistributor's license that was provided with the Content. If no such
license exists, contact the Redistributor. Unless otherwise indicated
below, the terms and conditions of the EPL still apply to any source
code in the Content and such source code may be obtained at <a
href="https://www.eclipse.org/">https://www.eclipse.org</a>.
</p>
</body>
</html>

View file

@ -1,7 +0,0 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.properties,\
about.html
src.includes = about.html

View file

@ -1,14 +0,0 @@
##################################################################################
# Copyright (c) 2020 Torbjörn Svensson and others. All rights reserved.
# This program and the accompanying materials are made available under the terms
# of the Eclipse Public License 2.0 which accompanies this distribution, and is
# available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Torbjörn Svensson - initial API and implementation
##################################################################################
pluginName = QML Tests
providerName = Eclipse CDT

View file

@ -1,968 +0,0 @@
ecma5defs = {
"!name": "ecma5",
"!define": {
"Error.prototype": "Error.prototype"
},
"Infinity": {
"!type": "number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Infinity",
"!doc": "A numeric value representing infinity."
},
"undefined": {
"!type": "?",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/undefined",
"!doc": "The value undefined."
},
"NaN": {
"!type": "number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/NaN",
"!doc": "A value representing Not-A-Number."
},
"Object": {
"!type": "fn()",
"getPrototypeOf": {
"!type": "fn(obj: ?) -> ?",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/getPrototypeOf",
"!doc": "Returns the prototype (i.e. the internal prototype) of the specified object."
},
"create": {
"!type": "fn(proto: ?) -> !custom:Object_create",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/create",
"!doc": "Creates a new object with the specified prototype object and properties."
},
"defineProperty": {
"!type": "fn(obj: ?, prop: string, desc: ?) -> !custom:Object_defineProperty",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/defineProperty",
"!doc": "Defines a new property directly on an object, or modifies an existing property on an object, and returns the object. If you want to see how to use the Object.defineProperty method with a binary-flags-like syntax, see this article."
},
"defineProperties": {
"!type": "fn(obj: ?, props: ?) -> !custom:Object_defineProperties",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/defineProperty",
"!doc": "Defines a new property directly on an object, or modifies an existing property on an object, and returns the object. If you want to see how to use the Object.defineProperty method with a binary-flags-like syntax, see this article."
},
"getOwnPropertyDescriptor": {
"!type": "fn(obj: ?, prop: string) -> ?",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor",
"!doc": "Returns a property descriptor for an own property (that is, one directly present on an object, not present by dint of being along an object's prototype chain) of a given object."
},
"keys": {
"!type": "fn(obj: ?) -> [string]",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/keys",
"!doc": "Returns an array of a given object's own enumerable properties, in the same order as that provided by a for-in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well)."
},
"getOwnPropertyNames": {
"!type": "fn(obj: ?) -> [string]",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames",
"!doc": "Returns an array of all properties (enumerable or not) found directly upon a given object."
},
"seal": {
"!type": "fn(obj: ?)",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/seal",
"!doc": "Seals an object, preventing new properties from being added to it and marking all existing properties as non-configurable. Values of present properties can still be changed as long as they are writable."
},
"isSealed": {
"!type": "fn(obj: ?) -> bool",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/isSealed",
"!doc": "Determine if an object is sealed."
},
"freeze": {
"!type": "fn(obj: ?) -> !0",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/freeze",
"!doc": "Freezes an object: that is, prevents new properties from being added to it; prevents existing properties from being removed; and prevents existing properties, or their enumerability, configurability, or writability, from being changed. In essence the object is made effectively immutable. The method returns the object being frozen."
},
"isFrozen": {
"!type": "fn(obj: ?) -> bool",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/isFrozen",
"!doc": "Determine if an object is frozen."
},
"preventExtensions": {
"!type": "fn(obj: ?)",
"!url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/preventExtensions",
"!doc": "Prevents new properties from ever being added to an object."
},
"isExtensible": {
"!type": "fn(obj: ?) -> bool",
"!url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible",
"!doc": "The Object.isExtensible() method determines if an object is extensible (whether it can have new properties added to it)."
},
"prototype": {
"!stdProto": "Object",
"toString": {
"!type": "fn() -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/toString",
"!doc": "Returns a string representing the object."
},
"toLocaleString": {
"!type": "fn() -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/toLocaleString",
"!doc": "Returns a string representing the object. This method is meant to be overriden by derived objects for locale-specific purposes."
},
"valueOf": {
"!type": "fn() -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/valueOf",
"!doc": "Returns the primitive value of the specified object"
},
"hasOwnProperty": {
"!type": "fn(prop: string) -> bool",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/hasOwnProperty",
"!doc": "Returns a boolean indicating whether the object has the specified property."
},
"propertyIsEnumerable": {
"!type": "fn(prop: string) -> bool",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/propertyIsEnumerable",
"!doc": "Returns a Boolean indicating whether the specified property is enumerable."
},
"isPrototypeOf": {
"!type": "fn(obj: ?) -> bool",
"!url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isPrototypeOf",
"!doc": "Tests for an object in another object's prototype chain."
}
},
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object",
"!doc": "Creates an object wrapper."
},
"Function": {
"!type": "fn(body: string) -> fn()",
"prototype": {
"!stdProto": "Function",
"apply": {
"!type": "fn(this: ?, args: [?])",
"!effects": [
"call and return !this this=!0 !1.<i> !1.<i> !1.<i>"
],
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function/apply",
"!doc": "Calls a function with a given this value and arguments provided as an array (or an array like object)."
},
"call": {
"!type": "fn(this: ?, args?: ?) -> !this.!ret",
"!effects": [
"call and return !this this=!0 !1 !2 !3 !4"
],
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function/call",
"!doc": "Calls a function with a given this value and arguments provided individually."
},
"bind": {
"!type": "fn(this: ?, args?: ?) -> !custom:Function_bind",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function/bind",
"!doc": "Creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function was called."
},
"prototype": "?"
},
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function",
"!doc": "Every function in JavaScript is actually a Function object."
},
"Array": {
"!type": "fn(size: number) -> !custom:Array_ctor",
"isArray": {
"!type": "fn(value: ?) -> bool",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/isArray",
"!doc": "Returns true if an object is an array, false if it is not."
},
"prototype": {
"!stdProto": "Array",
"length": {
"!type": "number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/length",
"!doc": "An unsigned, 32-bit integer that specifies the number of elements in an array."
},
"concat": {
"!type": "fn(other: [?]) -> !this",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/concat",
"!doc": "Returns a new array comprised of this array joined with other array(s) and/or value(s)."
},
"join": {
"!type": "fn(separator?: string) -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/join",
"!doc": "Joins all elements of an array into a string."
},
"splice": {
"!type": "fn(pos: number, amount: number)",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/splice",
"!doc": "Changes the content of an array, adding new elements while removing old elements."
},
"pop": {
"!type": "fn() -> !this.<i>",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/pop",
"!doc": "Removes the last element from an array and returns that element."
},
"push": {
"!type": "fn(newelt: ?) -> number",
"!effects": [
"propagate !0 !this.<i>"
],
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/push",
"!doc": "Mutates an array by appending the given elements and returning the new length of the array."
},
"shift": {
"!type": "fn() -> !this.<i>",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/shift",
"!doc": "Removes the first element from an array and returns that element. This method changes the length of the array."
},
"unshift": {
"!type": "fn(newelt: ?) -> number",
"!effects": [
"propagate !0 !this.<i>"
],
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/unshift",
"!doc": "Adds one or more elements to the beginning of an array and returns the new length of the array."
},
"slice": {
"!type": "fn(from: number, to?: number) -> !this",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/slice",
"!doc": "Returns a shallow copy of a portion of an array."
},
"reverse": {
"!type": "fn()",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/reverse",
"!doc": "Reverses an array in place. The first array element becomes the last and the last becomes the first."
},
"sort": {
"!type": "fn(compare?: fn(a: ?, b: ?) -> number)",
"!effects": [
"call !0 !this.<i> !this.<i>"
],
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/sort",
"!doc": "Sorts the elements of an array in place and returns the array."
},
"indexOf": {
"!type": "fn(elt: ?, from?: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/indexOf",
"!doc": "Returns the first index at which a given element can be found in the array, or -1 if it is not present."
},
"lastIndexOf": {
"!type": "fn(elt: ?, from?: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/lastIndexOf",
"!doc": "Returns the last index at which a given element can be found in the array, or -1 if it is not present. The array is searched backwards, starting at fromIndex."
},
"every": {
"!type": "fn(test: fn(elt: ?, i: number) -> bool, context?: ?) -> bool",
"!effects": [
"call !0 this=!1 !this.<i> number"
],
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/every",
"!doc": "Tests whether all elements in the array pass the test implemented by the provided function."
},
"some": {
"!type": "fn(test: fn(elt: ?, i: number) -> bool, context?: ?) -> bool",
"!effects": [
"call !0 this=!1 !this.<i> number"
],
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/some",
"!doc": "Tests whether some element in the array passes the test implemented by the provided function."
},
"filter": {
"!type": "fn(test: fn(elt: ?, i: number) -> bool, context?: ?) -> !this",
"!effects": [
"call !0 this=!1 !this.<i> number"
],
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/filter",
"!doc": "Creates a new array with all elements that pass the test implemented by the provided function."
},
"forEach": {
"!type": "fn(f: fn(elt: ?, i: number), context?: ?)",
"!effects": [
"call !0 this=!1 !this.<i> number"
],
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/forEach",
"!doc": "Executes a provided function once per array element."
},
"map": {
"!type": "fn(f: fn(elt: ?, i: number) -> ?, context?: ?) -> [!0.!ret]",
"!effects": [
"call !0 this=!1 !this.<i> number"
],
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/map",
"!doc": "Creates a new array with the results of calling a provided function on every element in this array."
},
"reduce": {
"!type": "fn(combine: fn(sum: ?, elt: ?, i: number) -> ?, init?: ?) -> !0.!ret",
"!effects": [
"call !0 !1 !this.<i> number"
],
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/Reduce",
"!doc": "Apply a function against an accumulator and each value of the array (from left-to-right) as to reduce it to a single value."
},
"reduceRight": {
"!type": "fn(combine: fn(sum: ?, elt: ?, i: number) -> ?, init?: ?) -> !0.!ret",
"!effects": [
"call !0 !1 !this.<i> number"
],
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/ReduceRight",
"!doc": "Apply a function simultaneously against two values of the array (from right-to-left) as to reduce it to a single value."
}
},
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array",
"!doc": "The JavaScript Array global object is a constructor for arrays, which are high-level, list-like objects."
},
"String": {
"!type": "fn(value: ?) -> string",
"fromCharCode": {
"!type": "fn(code: number) -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/fromCharCode",
"!doc": "Returns a string created by using the specified sequence of Unicode values."
},
"prototype": {
"!stdProto": "String",
"length": {
"!type": "number",
"!url": "https://developer.mozilla.org/en/docs/JavaScript/Reference/Global_Objects/String/length",
"!doc": "Represents the length of a string."
},
"<i>": "string",
"charAt": {
"!type": "fn(i: number) -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/charAt",
"!doc": "Returns the specified character from a string."
},
"charCodeAt": {
"!type": "fn(i: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/charCodeAt",
"!doc": "Returns the numeric Unicode value of the character at the given index (except for unicode codepoints > 0x10000)."
},
"indexOf": {
"!type": "fn(char: string, from?: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/indexOf",
"!doc": "Returns the index within the calling String object of the first occurrence of the specified value, starting the search at fromIndex,\nreturns -1 if the value is not found."
},
"lastIndexOf": {
"!type": "fn(char: string, from?: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/lastIndexOf",
"!doc": "Returns the index within the calling String object of the last occurrence of the specified value, or -1 if not found. The calling string is searched backward, starting at fromIndex."
},
"substring": {
"!type": "fn(from: number, to?: number) -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/substring",
"!doc": "Returns a subset of a string between one index and another, or through the end of the string."
},
"substr": {
"!type": "fn(from: number, length?: number) -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/substr",
"!doc": "Returns the characters in a string beginning at the specified location through the specified number of characters."
},
"slice": {
"!type": "fn(from: number, to?: number) -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/slice",
"!doc": "Extracts a section of a string and returns a new string."
},
"trim": {
"!type": "fn() -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/Trim",
"!doc": "Removes whitespace from both ends of the string."
},
"toUpperCase": {
"!type": "fn() -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/toUpperCase",
"!doc": "Returns the calling string value converted to uppercase."
},
"toLowerCase": {
"!type": "fn() -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/toLowerCase",
"!doc": "Returns the calling string value converted to lowercase."
},
"toLocaleUpperCase": {
"!type": "fn() -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase",
"!doc": "Returns the calling string value converted to upper case, according to any locale-specific case mappings."
},
"toLocaleLowerCase": {
"!type": "fn() -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase",
"!doc": "Returns the calling string value converted to lower case, according to any locale-specific case mappings."
},
"split": {
"!type": "fn(pattern: string) -> [string]",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/split",
"!doc": "Splits a String object into an array of strings by separating the string into substrings."
},
"concat": {
"!type": "fn(other: string) -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/concat",
"!doc": "Combines the text of two or more strings and returns a new string."
},
"localeCompare": {
"!type": "fn(other: string) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/localeCompare",
"!doc": "Returns a number indicating whether a reference string comes before or after or is the same as the given string in sort order."
},
"match": {
"!type": "fn(pattern: +RegExp) -> [string]",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/match",
"!doc": "Used to retrieve the matches when matching a string against a regular expression."
},
"replace": {
"!type": "fn(pattern: string|+RegExp, replacement: string) -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/replace",
"!doc": "Returns a new string with some or all matches of a pattern replaced by a replacement. The pattern can be a string or a RegExp, and the replacement can be a string or a function to be called for each match."
},
"search": {
"!type": "fn(pattern: +RegExp) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/search",
"!doc": "Executes the search for a match between a regular expression and this String object."
}
},
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String",
"!doc": "The String global object is a constructor for strings, or a sequence of characters."
},
"Number": {
"!type": "fn(value: ?) -> number",
"MAX_VALUE": {
"!type": "number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number/MAX_VALUE",
"!doc": "The maximum numeric value representable in JavaScript."
},
"MIN_VALUE": {
"!type": "number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number/MIN_VALUE",
"!doc": "The smallest positive numeric value representable in JavaScript."
},
"POSITIVE_INFINITY": {
"!type": "number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number/POSITIVE_INFINITY",
"!doc": "A value representing the positive Infinity value."
},
"NEGATIVE_INFINITY": {
"!type": "number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number/NEGATIVE_INFINITY",
"!doc": "A value representing the negative Infinity value."
},
"prototype": {
"!stdProto": "Number",
"toString": {
"!type": "fn(radix?: number) -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number/toString",
"!doc": "Returns a string representing the specified Number object"
},
"toFixed": {
"!type": "fn(digits: number) -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number/toFixed",
"!doc": "Formats a number using fixed-point notation"
},
"toExponential": {
"!type": "fn(digits: number) -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number/toExponential",
"!doc": "Returns a string representing the Number object in exponential notation"
},
"toPrecision": {
"!type": "fn(digits: number) -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number/toPrecision",
"!doc": "The toPrecision() method returns a string representing the number to the specified precision."
}
},
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number",
"!doc": "The Number JavaScript object is a wrapper object allowing you to work with numerical values. A Number object is created using the Number() constructor."
},
"Boolean": {
"!type": "fn(value: ?) -> bool",
"prototype": {
"!stdProto": "Boolean"
},
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean",
"!doc": "The Boolean object is an object wrapper for a boolean value."
},
"RegExp": {
"!type": "fn(source: string, flags?: string)",
"prototype": {
"!stdProto": "RegExp",
"exec": {
"!type": "fn(input: string) -> [string]",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp/exec",
"!doc": "Executes a search for a match in a specified string. Returns a result array, or null."
},
"test": {
"!type": "fn(input: string) -> bool",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp/test",
"!doc": "Executes the search for a match between a regular expression and a specified string. Returns true or false."
},
"global": {
"!type": "bool",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp",
"!doc": "Creates a regular expression object for matching text with a pattern."
},
"ignoreCase": {
"!type": "bool",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp",
"!doc": "Creates a regular expression object for matching text with a pattern."
},
"multiline": {
"!type": "bool",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp/multiline",
"!doc": "Reflects whether or not to search in strings across multiple lines.\n"
},
"source": {
"!type": "string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp/source",
"!doc": "A read-only property that contains the text of the pattern, excluding the forward slashes.\n"
},
"lastIndex": {
"!type": "number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp/lastIndex",
"!doc": "A read/write integer property that specifies the index at which to start the next match."
}
},
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp",
"!doc": "Creates a regular expression object for matching text with a pattern."
},
"Date": {
"!type": "fn(ms: number)",
"parse": {
"!type": "fn(source: string) -> +Date",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/parse",
"!doc": "Parses a string representation of a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC."
},
"UTC": {
"!type": "fn(year: number, month: number, date: number, hour?: number, min?: number, sec?: number, ms?: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/UTC",
"!doc": "Accepts the same parameters as the longest form of the constructor, and returns the number of milliseconds in a Date object since January 1, 1970, 00:00:00, universal time."
},
"now": {
"!type": "fn() -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/now",
"!doc": "Returns the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC."
},
"prototype": {
"toUTCString": {
"!type": "fn() -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/toUTCString",
"!doc": "Converts a date to a string, using the universal time convention."
},
"toISOString": {
"!type": "fn() -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/toISOString",
"!doc": "JavaScript provides a direct way to convert a date object into a string in ISO format, the ISO 8601 Extended Format."
},
"toDateString": {
"!type": "fn() -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/toDateString",
"!doc": "Returns the date portion of a Date object in human readable form in American English."
},
"toTimeString": {
"!type": "fn() -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/toTimeString",
"!doc": "Returns the time portion of a Date object in human readable form in American English."
},
"toLocaleDateString": {
"!type": "fn() -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/toLocaleDateString",
"!doc": "Converts a date to a string, returning the \"date\" portion using the operating system's locale's conventions.\n"
},
"toLocaleTimeString": {
"!type": "fn() -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString",
"!doc": "Converts a date to a string, returning the \"time\" portion using the current locale's conventions."
},
"getTime": {
"!type": "fn() -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getTime",
"!doc": "Returns the numeric value corresponding to the time for the specified date according to universal time."
},
"getFullYear": {
"!type": "fn() -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getFullYear",
"!doc": "Returns the year of the specified date according to local time."
},
"getYear": {
"!type": "fn() -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getYear",
"!doc": "Returns the year in the specified date according to local time."
},
"getMonth": {
"!type": "fn() -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getMonth",
"!doc": "Returns the month in the specified date according to local time."
},
"getUTCMonth": {
"!type": "fn() -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getUTCMonth",
"!doc": "Returns the month of the specified date according to universal time.\n"
},
"getDate": {
"!type": "fn() -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getDate",
"!doc": "Returns the day of the month for the specified date according to local time."
},
"getUTCDate": {
"!type": "fn() -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getUTCDate",
"!doc": "Returns the day (date) of the month in the specified date according to universal time.\n"
},
"getDay": {
"!type": "fn() -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getDay",
"!doc": "Returns the day of the week for the specified date according to local time."
},
"getUTCDay": {
"!type": "fn() -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getUTCDay",
"!doc": "Returns the day of the week in the specified date according to universal time.\n"
},
"getHours": {
"!type": "fn() -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getHours",
"!doc": "Returns the hour for the specified date according to local time."
},
"getUTCHours": {
"!type": "fn() -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getUTCHours",
"!doc": "Returns the hours in the specified date according to universal time.\n"
},
"getMinutes": {
"!type": "fn() -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getMinutes",
"!doc": "Returns the minutes in the specified date according to local time."
},
"getUTCMinutes": {
"!type": "fn() -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date",
"!doc": "Creates JavaScript Date instances which let you work with dates and times."
},
"getSeconds": {
"!type": "fn() -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getSeconds",
"!doc": "Returns the seconds in the specified date according to local time."
},
"getUTCSeconds": {
"!type": "fn() -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getUTCSeconds",
"!doc": "Returns the seconds in the specified date according to universal time.\n"
},
"getMilliseconds": {
"!type": "fn() -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getMilliseconds",
"!doc": "Returns the milliseconds in the specified date according to local time."
},
"getUTCMilliseconds": {
"!type": "fn() -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getUTCMilliseconds",
"!doc": "Returns the milliseconds in the specified date according to universal time.\n"
},
"getTimezoneOffset": {
"!type": "fn() -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset",
"!doc": "Returns the time-zone offset from UTC, in minutes, for the current locale."
},
"setTime": {
"!type": "fn(date: +Date) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setTime",
"!doc": "Sets the Date object to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC.\n"
},
"setFullYear": {
"!type": "fn(year: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setFullYear",
"!doc": "Sets the full year for a specified date according to local time.\n"
},
"setUTCFullYear": {
"!type": "fn(year: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setUTCFullYear",
"!doc": "Sets the full year for a specified date according to universal time.\n"
},
"setMonth": {
"!type": "fn(month: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setMonth",
"!doc": "Set the month for a specified date according to local time."
},
"setUTCMonth": {
"!type": "fn(month: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setUTCMonth",
"!doc": "Sets the month for a specified date according to universal time.\n"
},
"setDate": {
"!type": "fn(day: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setDate",
"!doc": "Sets the day of the month for a specified date according to local time."
},
"setUTCDate": {
"!type": "fn(day: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setUTCDate",
"!doc": "Sets the day of the month for a specified date according to universal time.\n"
},
"setHours": {
"!type": "fn(hour: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setHours",
"!doc": "Sets the hours for a specified date according to local time, and returns the number of milliseconds since 1 January 1970 00:00:00 UTC until the time represented by the updated Date instance."
},
"setUTCHours": {
"!type": "fn(hour: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setUTCHours",
"!doc": "Sets the hour for a specified date according to universal time.\n"
},
"setMinutes": {
"!type": "fn(min: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setMinutes",
"!doc": "Sets the minutes for a specified date according to local time."
},
"setUTCMinutes": {
"!type": "fn(min: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setUTCMinutes",
"!doc": "Sets the minutes for a specified date according to universal time.\n"
},
"setSeconds": {
"!type": "fn(sec: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setSeconds",
"!doc": "Sets the seconds for a specified date according to local time."
},
"setUTCSeconds": {
"!type": "fn(sec: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setUTCSeconds",
"!doc": "Sets the seconds for a specified date according to universal time.\n"
},
"setMilliseconds": {
"!type": "fn(ms: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setMilliseconds",
"!doc": "Sets the milliseconds for a specified date according to local time.\n"
},
"setUTCMilliseconds": {
"!type": "fn(ms: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setUTCMilliseconds",
"!doc": "Sets the milliseconds for a specified date according to universal time.\n"
}
},
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date",
"!doc": "Creates JavaScript Date instances which let you work with dates and times."
},
"Error": {
"!type": "fn(message: string)",
"prototype": {
"name": {
"!type": "string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Error/name",
"!doc": "A name for the type of error."
},
"message": {
"!type": "string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Error/message",
"!doc": "A human-readable description of the error."
}
},
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Error",
"!doc": "Creates an error object."
},
"SyntaxError": {
"!type": "fn(message: string)",
"prototype": "Error.prototype",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/SyntaxError",
"!doc": "Represents an error when trying to interpret syntactically invalid code."
},
"ReferenceError": {
"!type": "fn(message: string)",
"prototype": "Error.prototype",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/ReferenceError",
"!doc": "Represents an error when a non-existent variable is referenced."
},
"URIError": {
"!type": "fn(message: string)",
"prototype": "Error.prototype",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/URIError",
"!doc": "Represents an error when a malformed URI is encountered."
},
"EvalError": {
"!type": "fn(message: string)",
"prototype": "Error.prototype",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/EvalError",
"!doc": "Represents an error regarding the eval function."
},
"RangeError": {
"!type": "fn(message: string)",
"prototype": "Error.prototype",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RangeError",
"!doc": "Represents an error when a number is not within the correct range allowed."
},
"TypeError": {
"!type": "fn(message: string)",
"prototype": "Error.prototype",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/TypeError",
"!doc": "Represents an error an error when a value is not of the expected type."
},
"parseInt": {
"!type": "fn(string: string, radix?: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/parseInt",
"!doc": "Parses a string argument and returns an integer of the specified radix or base."
},
"parseFloat": {
"!type": "fn(string: string) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/parseFloat",
"!doc": "Parses a string argument and returns a floating point number."
},
"isNaN": {
"!type": "fn(value: number) -> bool",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/isNaN",
"!doc": "Determines whether a value is NaN or not. Be careful, this function is broken. You may be interested in ECMAScript 6 Number.isNaN."
},
"isFinite": {
"!type": "fn(value: number) -> bool",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/isFinite",
"!doc": "Determines whether the passed value is a finite number."
},
"eval": {
"!type": "fn(code: string) -> ?",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/eval",
"!doc": "Evaluates JavaScript code represented as a string."
},
"encodeURI": {
"!type": "fn(uri: string) -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/encodeURI",
"!doc": "Encodes a Uniform Resource Identifier (URI) by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two \"surrogate\" characters)."
},
"encodeURIComponent": {
"!type": "fn(uri: string) -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/encodeURIComponent",
"!doc": "Encodes a Uniform Resource Identifier (URI) component by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two \"surrogate\" characters)."
},
"decodeURI": {
"!type": "fn(uri: string) -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/decodeURI",
"!doc": "Decodes a Uniform Resource Identifier (URI) previously created by encodeURI or by a similar routine."
},
"decodeURIComponent": {
"!type": "fn(uri: string) -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/decodeURIComponent",
"!doc": "Decodes a Uniform Resource Identifier (URI) component previously created by encodeURIComponent or by a similar routine."
},
"Math": {
"E": {
"!type": "number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/E",
"!doc": "The base of natural logarithms, e, approximately 2.718."
},
"LN2": {
"!type": "number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/LN2",
"!doc": "The natural logarithm of 2, approximately 0.693."
},
"LN10": {
"!type": "number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/LN10",
"!doc": "The natural logarithm of 10, approximately 2.302."
},
"LOG2E": {
"!type": "number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/LOG2E",
"!doc": "The base 2 logarithm of E (approximately 1.442)."
},
"LOG10E": {
"!type": "number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/LOG10E",
"!doc": "The base 10 logarithm of E (approximately 0.434)."
},
"SQRT1_2": {
"!type": "number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/SQRT1_2",
"!doc": "The square root of 1/2; equivalently, 1 over the square root of 2, approximately 0.707."
},
"SQRT2": {
"!type": "number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/SQRT2",
"!doc": "The square root of 2, approximately 1.414."
},
"PI": {
"!type": "number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/PI",
"!doc": "The ratio of the circumference of a circle to its diameter, approximately 3.14159."
},
"abs": {
"!type": "fn(number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/abs",
"!doc": "Returns the absolute value of a number."
},
"cos": {
"!type": "fn(number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/cos",
"!doc": "Returns the cosine of a number."
},
"sin": {
"!type": "fn(number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/sin",
"!doc": "Returns the sine of a number."
},
"tan": {
"!type": "fn(number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/tan",
"!doc": "Returns the tangent of a number."
},
"acos": {
"!type": "fn(number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/acos",
"!doc": "Returns the arccosine (in radians) of a number."
},
"asin": {
"!type": "fn(number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/asin",
"!doc": "Returns the arcsine (in radians) of a number."
},
"atan": {
"!type": "fn(number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/atan",
"!doc": "Returns the arctangent (in radians) of a number."
},
"atan2": {
"!type": "fn(y: number, x: number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/atan2",
"!doc": "Returns the arctangent of the quotient of its arguments."
},
"ceil": {
"!type": "fn(number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/ceil",
"!doc": "Returns the smallest integer greater than or equal to a number."
},
"floor": {
"!type": "fn(number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/floor",
"!doc": "Returns the largest integer less than or equal to a number."
},
"round": {
"!type": "fn(number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/round",
"!doc": "Returns the value of a number rounded to the nearest integer."
},
"exp": {
"!type": "fn(number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/exp",
"!doc": "Returns Ex, where x is the argument, and E is Euler's constant, the base of the natural logarithms."
},
"log": {
"!type": "fn(number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/log",
"!doc": "Returns the natural logarithm (base E) of a number."
},
"sqrt": {
"!type": "fn(number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/sqrt",
"!doc": "Returns the square root of a number."
},
"pow": {
"!type": "fn(number, number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/pow",
"!doc": "Returns base to the exponent power, that is, baseexponent."
},
"max": {
"!type": "fn(number, number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/max",
"!doc": "Returns the largest of zero or more numbers."
},
"min": {
"!type": "fn(number, number) -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/min",
"!doc": "Returns the smallest of zero or more numbers."
},
"random": {
"!type": "fn() -> number",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/random",
"!doc": "Returns a floating-point, pseudo-random number in the range [0, 1) that is, from 0 (inclusive) up to but not including 1 (exclusive), which you can then scale to your desired range."
},
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math",
"!doc": "A built-in object that has properties and methods for mathematical constants and functions."
},
"JSON": {
"parse": {
"!type": "fn(json: string) -> ?",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/parse",
"!doc": "Parse a string as JSON, optionally transforming the value produced by parsing."
},
"stringify": {
"!type": "fn(value: ?) -> string",
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/stringify",
"!doc": "Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified."
},
"!url": "https://developer.mozilla.org/en-US/docs/JSON",
"!doc": "JSON (JavaScript Object Notation) is a data-interchange format. It closely resembles a subset of JavaScript syntax, although it is not a strict subset. (See JSON in the JavaScript Reference for full details.) It is useful when writing any kind of JavaScript-based application, including websites and browser extensions. For example, you might store user information in JSON format in a cookie, or you might store extension preferences in JSON in a string-valued browser preference."
}
};

View file

@ -1,41 +0,0 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.cdt.qt.core.tests;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
public class Activator implements BundleActivator {
private static BundleContext context;
@Override
public void start(BundleContext context) throws Exception {
Activator.context = context;
}
@Override
public void stop(BundleContext context) throws Exception {
Activator.context = null;
}
public static Bundle getBundle() {
return context != null ? context.getBundle() : null;
}
public static <T> T getService(Class<T> service) {
ServiceReference<T> ref = context.getServiceReference(service);
return ref != null ? context.getService(ref) : null;
}
}

View file

@ -1,350 +0,0 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.cdt.qt.core.tests;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.cdt.qt.core.IQMLAnalyzer;
import org.eclipse.cdt.qt.core.QMLTernCompletion;
import org.eclipse.cdt.qt.core.qmljs.IJSBinaryExpression;
import org.eclipse.cdt.qt.core.qmljs.IJSBinaryExpression.BinaryOperator;
import org.eclipse.cdt.qt.core.qmljs.IQmlASTNode;
import org.eclipse.cdt.qt.core.qmljs.IQmlHeaderItem;
import org.eclipse.cdt.qt.core.qmljs.IQmlImport;
import org.eclipse.cdt.qt.core.qmljs.IQmlObjectMember;
import org.eclipse.cdt.qt.core.qmljs.IQmlProgram;
import org.eclipse.cdt.qt.core.qmljs.IQmlPropertyBinding;
import org.eclipse.cdt.qt.core.qmljs.IQmlRootObject;
import org.eclipse.cdt.qt.core.qmljs.IQmlScriptBinding;
import org.junit.BeforeClass;
import org.junit.Test;
@SuppressWarnings("nls")
public class NashornTests {
protected static IQMLAnalyzer analyzer;
@BeforeClass
public static void loadAnalyzer() {
analyzer = Activator.getService(IQMLAnalyzer.class);
}
protected void getCompletions(String code, QMLTernCompletion... expected) throws Throwable {
int pos = code.indexOf('|');
code = code.substring(0, pos) + code.substring(pos + 1);
Collection<QMLTernCompletion> QMLTernCompletions = analyzer.getCompletions("test1.qml", code, pos, false);
Map<String, QMLTernCompletion> set = new HashMap<>();
Set<String> unexpected = new HashSet<>();
for (QMLTernCompletion QMLTernCompletion : expected) {
set.put(QMLTernCompletion.getName(), QMLTernCompletion);
}
for (QMLTernCompletion QMLTernCompletion : QMLTernCompletions) {
String name = QMLTernCompletion.getName();
QMLTernCompletion c = set.get(name);
if (c != null) {
assertEquals(c.getType(), QMLTernCompletion.getType());
assertEquals(c.getOrigin(), QMLTernCompletion.getOrigin());
set.remove(name);
} else {
unexpected.add(name);
}
}
if (!set.isEmpty()) {
fail("Missing names: " + String.join(", ", set.keySet()));
}
if (!unexpected.isEmpty()) {
fail("Unexpected names: " + String.join(", ", unexpected));
}
}
@Test
public void testParseFile1() throws Throwable {
IQmlASTNode node = analyzer.parseFile("main.qml", "");
assertEquals("Unexpected program node type", "QMLProgram", node.getType());
}
@Test
public void testParseFile2() throws Throwable {
IQmlASTNode node = analyzer.parseFile("main.qml", "import QtQuick 2.2");
assertThat(node, instanceOf(IQmlProgram.class));
IQmlProgram program = (IQmlProgram) node;
List<IQmlHeaderItem> headerItems = program.getHeaderItemList().getItems();
assertEquals("Unexpected number of header items", 1, headerItems.size());
assertThat(headerItems.get(0), instanceOf(IQmlImport.class));
IQmlImport imp = (IQmlImport) headerItems.get(0);
assertEquals("Unexpected module identifier", "QtQuick", imp.getModule().getIdentifier().getName());
assertEquals("Unexpected module raw version", "2.2", imp.getModule().getVersion().getRaw());
assertEquals("Unexpected module version", 2.2, imp.getModule().getVersion().getValue(), 0.0001d);
}
@Test
public void testParseString1() throws Throwable {
IQmlASTNode node = analyzer.parseString("", "qml", true, true);
assertEquals("Unexpected program node type", "QMLProgram", node.getType());
}
@Test
public void testParseString2() throws Throwable {
IQmlASTNode node = analyzer.parseString("import QtQuick 2.2", "qml", true, true);
assertThat(node, instanceOf(IQmlProgram.class));
IQmlProgram program = (IQmlProgram) node;
List<IQmlHeaderItem> headerItems = program.getHeaderItemList().getItems();
assertEquals("Unexpected number of header items", 1, headerItems.size());
assertThat(headerItems.get(0), instanceOf(IQmlImport.class));
IQmlImport imp = (IQmlImport) headerItems.get(0);
assertEquals("Unexpected module identifier", "QtQuick", imp.getModule().getIdentifier().getName());
assertEquals("Unexpected module raw version", "2.2", imp.getModule().getVersion().getRaw());
assertEquals("Unexpected module version", 2.2, imp.getModule().getVersion().getValue(), 0.0001d);
}
@Test
public void testParseString3() throws Throwable {
IQmlASTNode node = analyzer.parseString("import QtQuick 2.2", "qml", true, true);
assertThat(node, instanceOf(IQmlProgram.class));
IQmlProgram program = (IQmlProgram) node;
List<IQmlHeaderItem> headerItems = program.getHeaderItemList().getItems();
assertEquals("Unexpected number of header items", 1, headerItems.size());
assertThat(headerItems.get(0), instanceOf(IQmlImport.class));
IQmlImport imp = (IQmlImport) headerItems.get(0);
assertEquals("Unexpected start range", 0, imp.getRange()[0]);
assertEquals("Unexpected end range", 18, imp.getRange()[1]);
}
@Test
public void testParseString4() throws Throwable {
IQmlASTNode node = analyzer.parseString("import QtQuick 2.2", "qml", true, true);
assertThat(node, instanceOf(IQmlProgram.class));
IQmlProgram program = (IQmlProgram) node;
List<IQmlHeaderItem> headerItems = program.getHeaderItemList().getItems();
assertEquals("Unexpected number of header items", 1, headerItems.size());
assertThat(headerItems.get(0), instanceOf(IQmlImport.class));
IQmlImport imp = (IQmlImport) headerItems.get(0);
assertEquals("Unexpected start line", 1, imp.getLocation().getStart().getLine());
assertEquals("Unexpected start column", 0, imp.getLocation().getStart().getColumn());
assertEquals("Unexpected start line", 1, imp.getLocation().getEnd().getLine());
assertEquals("Unexpected start column", 18, imp.getLocation().getEnd().getColumn());
}
@Test
public void testParseString5() throws Throwable {
IQmlASTNode node = analyzer.parseString("QtObject {}", "qml", true, true);
assertThat(node, instanceOf(IQmlProgram.class));
IQmlProgram program = (IQmlProgram) node;
List<IQmlHeaderItem> headerItems = program.getHeaderItemList().getItems();
assertEquals("Unexpected number of header items", 0, headerItems.size());
assertNotNull("Root object was null", program.getRootObject());
IQmlRootObject root = program.getRootObject();
assertEquals("Unexpected root object type", "QMLObjectDefinition", root.getType());
assertEquals("Unexpected root object identifier", "QtObject", root.getIdentifier().getName());
}
@Test
public void testParseString6() throws Throwable {
IQmlASTNode node = analyzer.parseString("QtObject {s: 3 + 3}", "qml", true, true);
assertThat(node, instanceOf(IQmlProgram.class));
IQmlProgram program = (IQmlProgram) node;
assertNotNull("Root object was null", program.getRootObject());
IQmlRootObject root = program.getRootObject();
List<IQmlObjectMember> members = root.getBody().getMembers();
assertEquals("Unexpected number of root object members", 1, members.size());
assertThat(members.get(0), instanceOf(IQmlPropertyBinding.class));
IQmlPropertyBinding bind = (IQmlPropertyBinding) members.get(0);
assertThat(bind.getBinding(), instanceOf(IQmlScriptBinding.class));
IQmlScriptBinding scriptBinding = (IQmlScriptBinding) bind.getBinding();
assertFalse("Script binding was not a JavaScript expression", scriptBinding.isBlock());
assertThat(scriptBinding.getScript(), instanceOf(IJSBinaryExpression.class));
assertEquals("Unexpected expression type", "BinaryExpression", scriptBinding.getScript().getType());
IJSBinaryExpression expr = (IJSBinaryExpression) scriptBinding.getScript();
assertEquals("Unexpected binary operator", BinaryOperator.Add, expr.getOperator());
}
@Test
public void testCompletions1() throws Throwable {
if (analyzer == null) {
return;
}
getCompletions("Window {\n\tproperty int height\n\the|\n}",
new QMLTernCompletion("height", "number", "test1.qml"));
}
@Test
public void testCompletions2() throws Throwable {
if (analyzer == null) {
return;
}
getCompletions("Window {\n\tproperty int height\n\tproperty int width\n\tproperty string text\n\t|\n}",
new QMLTernCompletion("height", "number", "test1.qml"),
new QMLTernCompletion("text", "string", "test1.qml"),
new QMLTernCompletion("width", "number", "test1.qml"));
}
@Test
public void testCompletions3() throws Throwable {
if (analyzer == null) {
return;
}
getCompletions("Window {\n\tproperty int height\n\tObject {\n\t\t|\n\t}\n}");
}
@Test
public void testCompletions4() throws Throwable {
if (analyzer == null) {
return;
}
getCompletions("Window {\n\tproperty var test: |\n}",
new QMLTernCompletion("decodeURI", "fn(uri: string) -> string", "ecma5"),
new QMLTernCompletion("decodeURIComponent", "fn(uri: string) -> string", "ecma5"),
new QMLTernCompletion("encodeURI", "fn(uri: string) -> string", "ecma5"),
new QMLTernCompletion("encodeURIComponent", "fn(uri: string) -> string", "ecma5"),
new QMLTernCompletion("eval", "fn(code: string)", "ecma5"),
new QMLTernCompletion("isFinite", "fn(value: number) -> bool", "ecma5"),
new QMLTernCompletion("isNaN", "fn(value: number) -> bool", "ecma5"),
new QMLTernCompletion("parseFloat", "fn(string: string) -> number", "ecma5"),
new QMLTernCompletion("parseInt", "fn(string: string, radix?: number) -> number", "ecma5"),
new QMLTernCompletion("test", "?", "test1.qml"), new QMLTernCompletion("undefined", "?", "ecma5"),
new QMLTernCompletion("Array", "fn(size: number)", "ecma5"),
new QMLTernCompletion("Boolean", "fn(value: ?) -> bool", "ecma5"),
new QMLTernCompletion("Date", "fn(ms: number)", "ecma5"),
new QMLTernCompletion("Error", "fn(message: string)", "ecma5"),
new QMLTernCompletion("EvalError", "fn(message: string)", "ecma5"),
new QMLTernCompletion("Function", "fn(body: string) -> fn()", "ecma5"),
new QMLTernCompletion("Infinity", "number", "ecma5"), new QMLTernCompletion("JSON", "JSON", "ecma5"),
new QMLTernCompletion("Math", "Math", "ecma5"), new QMLTernCompletion("NaN", "number", "ecma5"),
new QMLTernCompletion("Number", "fn(value: ?) -> number", "ecma5"),
new QMLTernCompletion("Object", "fn()", "ecma5"),
new QMLTernCompletion("RangeError", "fn(message: string)", "ecma5"),
new QMLTernCompletion("ReferenceError", "fn(message: string)", "ecma5"),
new QMLTernCompletion("RegExp", "fn(source: string, flags?: string)", "ecma5"),
new QMLTernCompletion("String", "fn(value: ?) -> string", "ecma5"),
new QMLTernCompletion("SyntaxError", "fn(message: string)", "ecma5"),
new QMLTernCompletion("TypeError", "fn(message: string)", "ecma5"),
new QMLTernCompletion("URIError", "fn(message: string)", "ecma5"));
}
@Test
public void testCompletions5() throws Throwable {
if (analyzer == null) {
return;
}
getCompletions("Window {\n\ttest: |\n}",
new QMLTernCompletion("decodeURI", "fn(uri: string) -> string", "ecma5"),
new QMLTernCompletion("decodeURIComponent", "fn(uri: string) -> string", "ecma5"),
new QMLTernCompletion("encodeURI", "fn(uri: string) -> string", "ecma5"),
new QMLTernCompletion("encodeURIComponent", "fn(uri: string) -> string", "ecma5"),
new QMLTernCompletion("eval", "fn(code: string)", "ecma5"),
new QMLTernCompletion("isFinite", "fn(value: number) -> bool", "ecma5"),
new QMLTernCompletion("isNaN", "fn(value: number) -> bool", "ecma5"),
new QMLTernCompletion("parseFloat", "fn(string: string) -> number", "ecma5"),
new QMLTernCompletion("parseInt", "fn(string: string, radix?: number) -> number", "ecma5"),
new QMLTernCompletion("undefined", "?", "ecma5"),
new QMLTernCompletion("Array", "fn(size: number)", "ecma5"),
new QMLTernCompletion("Boolean", "fn(value: ?) -> bool", "ecma5"),
new QMLTernCompletion("Date", "fn(ms: number)", "ecma5"),
new QMLTernCompletion("Error", "fn(message: string)", "ecma5"),
new QMLTernCompletion("EvalError", "fn(message: string)", "ecma5"),
new QMLTernCompletion("Function", "fn(body: string) -> fn()", "ecma5"),
new QMLTernCompletion("Infinity", "number", "ecma5"), new QMLTernCompletion("JSON", "JSON", "ecma5"),
new QMLTernCompletion("Math", "Math", "ecma5"), new QMLTernCompletion("NaN", "number", "ecma5"),
new QMLTernCompletion("Number", "fn(value: ?) -> number", "ecma5"),
new QMLTernCompletion("Object", "fn()", "ecma5"),
new QMLTernCompletion("RangeError", "fn(message: string)", "ecma5"),
new QMLTernCompletion("ReferenceError", "fn(message: string)", "ecma5"),
new QMLTernCompletion("RegExp", "fn(source: string, flags?: string)", "ecma5"),
new QMLTernCompletion("String", "fn(value: ?) -> string", "ecma5"),
new QMLTernCompletion("SyntaxError", "fn(message: string)", "ecma5"),
new QMLTernCompletion("TypeError", "fn(message: string)", "ecma5"),
new QMLTernCompletion("URIError", "fn(message: string)", "ecma5"));
}
@Test
public void testCompletions6() throws Throwable {
if (analyzer == null) {
return;
}
getCompletions("Window {\n\ttest: {\n\t\t|\n\t}\n}",
new QMLTernCompletion("decodeURI", "fn(uri: string) -> string", "ecma5"),
new QMLTernCompletion("decodeURIComponent", "fn(uri: string) -> string", "ecma5"),
new QMLTernCompletion("encodeURI", "fn(uri: string) -> string", "ecma5"),
new QMLTernCompletion("encodeURIComponent", "fn(uri: string) -> string", "ecma5"),
new QMLTernCompletion("eval", "fn(code: string)", "ecma5"),
new QMLTernCompletion("isFinite", "fn(value: number) -> bool", "ecma5"),
new QMLTernCompletion("isNaN", "fn(value: number) -> bool", "ecma5"),
new QMLTernCompletion("parseFloat", "fn(string: string) -> number", "ecma5"),
new QMLTernCompletion("parseInt", "fn(string: string, radix?: number) -> number", "ecma5"),
new QMLTernCompletion("undefined", "?", "ecma5"),
new QMLTernCompletion("Array", "fn(size: number)", "ecma5"),
new QMLTernCompletion("Boolean", "fn(value: ?) -> bool", "ecma5"),
new QMLTernCompletion("Date", "fn(ms: number)", "ecma5"),
new QMLTernCompletion("Error", "fn(message: string)", "ecma5"),
new QMLTernCompletion("EvalError", "fn(message: string)", "ecma5"),
new QMLTernCompletion("Function", "fn(body: string) -> fn()", "ecma5"),
new QMLTernCompletion("Infinity", "number", "ecma5"), new QMLTernCompletion("JSON", "JSON", "ecma5"),
new QMLTernCompletion("Math", "Math", "ecma5"), new QMLTernCompletion("NaN", "number", "ecma5"),
new QMLTernCompletion("Number", "fn(value: ?) -> number", "ecma5"),
new QMLTernCompletion("Object", "fn()", "ecma5"),
new QMLTernCompletion("RangeError", "fn(message: string)", "ecma5"),
new QMLTernCompletion("ReferenceError", "fn(message: string)", "ecma5"),
new QMLTernCompletion("RegExp", "fn(source: string, flags?: string)", "ecma5"),
new QMLTernCompletion("String", "fn(value: ?) -> string", "ecma5"),
new QMLTernCompletion("SyntaxError", "fn(message: string)", "ecma5"),
new QMLTernCompletion("TypeError", "fn(message: string)", "ecma5"),
new QMLTernCompletion("URIError", "fn(message: string)", "ecma5"));
}
@Test
public void testCompletions7() throws Throwable {
if (analyzer == null) {
return;
}
getCompletions("Window {\n\tfunction test() {\n\t\t|\n\t}\n}",
new QMLTernCompletion("decodeURI", "fn(uri: string) -> string", "ecma5"),
new QMLTernCompletion("decodeURIComponent", "fn(uri: string) -> string", "ecma5"),
new QMLTernCompletion("encodeURI", "fn(uri: string) -> string", "ecma5"),
new QMLTernCompletion("encodeURIComponent", "fn(uri: string) -> string", "ecma5"),
new QMLTernCompletion("eval", "fn(code: string)", "ecma5"),
new QMLTernCompletion("isFinite", "fn(value: number) -> bool", "ecma5"),
new QMLTernCompletion("isNaN", "fn(value: number) -> bool", "ecma5"),
new QMLTernCompletion("parseFloat", "fn(string: string) -> number", "ecma5"),
new QMLTernCompletion("parseInt", "fn(string: string, radix?: number) -> number", "ecma5"),
new QMLTernCompletion("test", "fn()", "test1.qml"), new QMLTernCompletion("undefined", "?", "ecma5"),
new QMLTernCompletion("Array", "fn(size: number)", "ecma5"),
new QMLTernCompletion("Boolean", "fn(value: ?) -> bool", "ecma5"),
new QMLTernCompletion("Date", "fn(ms: number)", "ecma5"),
new QMLTernCompletion("Error", "fn(message: string)", "ecma5"),
new QMLTernCompletion("EvalError", "fn(message: string)", "ecma5"),
new QMLTernCompletion("Function", "fn(body: string) -> fn()", "ecma5"),
new QMLTernCompletion("Infinity", "number", "ecma5"), new QMLTernCompletion("JSON", "JSON", "ecma5"),
new QMLTernCompletion("Math", "Math", "ecma5"), new QMLTernCompletion("NaN", "number", "ecma5"),
new QMLTernCompletion("Number", "fn(value: ?) -> number", "ecma5"),
new QMLTernCompletion("Object", "fn()", "ecma5"),
new QMLTernCompletion("RangeError", "fn(message: string)", "ecma5"),
new QMLTernCompletion("ReferenceError", "fn(message: string)", "ecma5"),
new QMLTernCompletion("RegExp", "fn(source: string, flags?: string)", "ecma5"),
new QMLTernCompletion("String", "fn(value: ?) -> string", "ecma5"),
new QMLTernCompletion("SyntaxError", "fn(message: string)", "ecma5"),
new QMLTernCompletion("TypeError", "fn(message: string)", "ecma5"),
new QMLTernCompletion("URIError", "fn(message: string)", "ecma5"));
}
}

View file

@ -1,212 +0,0 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.qt.core.tests;
import static org.junit.Assert.assertEquals;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import org.eclipse.cdt.internal.qt.core.location.Position;
import org.eclipse.cdt.qt.core.qmldir.QMLDirectoryLexer;
import org.eclipse.cdt.qt.core.qmldir.QMLDirectoryLexer.Token;
import org.eclipse.cdt.qt.core.qmldir.QMLDirectoryLexer.TokenType;
import org.junit.Test;
@SuppressWarnings("nls")
public class QMLDirectoryLexerTests {
private void assertToken(TokenType type, String text, int start, int end, Position locStart, Position locEnd,
Token actual) {
// Check token type and text
assertEquals("Unexpected token type", type, actual.getType());
assertEquals("Unexpected token text", text, actual.getText());
// Check position offsets
assertEquals("Unexpected start position", start, actual.getStart());
assertEquals("Unexpected end position", end, actual.getEnd());
// Check SourceLocation start
assertEquals("Unexpected location start line", locStart.getLine(), actual.getLocation().getStart().getLine());
assertEquals("Unexpected location start column", locStart.getColumn(),
actual.getLocation().getStart().getColumn());
// Check SourceLocation end
assertEquals("Unexpected location end line", locEnd.getLine(), actual.getLocation().getEnd().getLine());
assertEquals("Unexpected location end column", locEnd.getColumn(), actual.getLocation().getEnd().getColumn());
}
private InputStream createInputStream(String s) {
return new ByteArrayInputStream(s.getBytes());
}
@Test
public void testCommentToken() {
QMLDirectoryLexer lexer = new QMLDirectoryLexer();
lexer.setInput(new ByteArrayInputStream("# This is a comment".getBytes()));
assertToken(TokenType.COMMENT, "# This is a comment", 0, 19, new Position(1, 0), new Position(1, 19),
lexer.nextToken(false));
}
@Test
public void testMultipleCommentTokens() {
QMLDirectoryLexer lexer = new QMLDirectoryLexer();
lexer.setInput(createInputStream("# This is a comment\n# This is another comment\n"));
assertToken(TokenType.COMMENT, "# This is a comment", 0, 19, new Position(1, 0), new Position(1, 19),
lexer.nextToken(false));
assertEquals(TokenType.COMMAND_END, lexer.nextToken(false).getType());
assertToken(TokenType.COMMENT, "# This is another comment", 20, 45, new Position(2, 0), new Position(2, 25),
lexer.nextToken(false));
assertEquals(TokenType.COMMAND_END, lexer.nextToken(false).getType());
assertEquals(TokenType.EOF, lexer.nextToken(false).getType());
}
@Test
public void testModuleToken() {
QMLDirectoryLexer lexer = new QMLDirectoryLexer();
lexer.setInput(createInputStream("module"));
assertToken(TokenType.MODULE, "module", 0, 6, new Position(1, 0), new Position(1, 6), lexer.nextToken());
}
@Test
public void testTypeInfoToken() {
QMLDirectoryLexer lexer = new QMLDirectoryLexer();
lexer.setInput(createInputStream("typeinfo"));
assertToken(TokenType.TYPEINFO, "typeinfo", 0, 8, new Position(1, 0), new Position(1, 8), lexer.nextToken());
}
@Test
public void testSingletonToken() {
QMLDirectoryLexer lexer = new QMLDirectoryLexer();
lexer.setInput(createInputStream("singleton"));
assertToken(TokenType.SINGLETON, "singleton", 0, 9, new Position(1, 0), new Position(1, 9), lexer.nextToken());
}
@Test
public void testInternalToken() {
QMLDirectoryLexer lexer = new QMLDirectoryLexer();
lexer.setInput(createInputStream("internal"));
assertToken(TokenType.INTERNAL, "internal", 0, 8, new Position(1, 0), new Position(1, 8), lexer.nextToken());
}
@Test
public void testPluginToken() {
QMLDirectoryLexer lexer = new QMLDirectoryLexer();
lexer.setInput(createInputStream("plugin"));
assertToken(TokenType.PLUGIN, "plugin", 0, 6, new Position(1, 0), new Position(1, 6), lexer.nextToken());
}
@Test
public void testClassnameToken() {
QMLDirectoryLexer lexer = new QMLDirectoryLexer();
lexer.setInput(createInputStream("classname"));
assertToken(TokenType.CLASSNAME, "classname", 0, 9, new Position(1, 0), new Position(1, 9), lexer.nextToken());
}
@Test
public void testDependsToken() {
QMLDirectoryLexer lexer = new QMLDirectoryLexer();
lexer.setInput(createInputStream("depends"));
assertToken(TokenType.DEPENDS, "depends", 0, 7, new Position(1, 0), new Position(1, 7), lexer.nextToken());
}
@Test
public void testDesignerSupportedToken() {
QMLDirectoryLexer lexer = new QMLDirectoryLexer();
lexer.setInput(createInputStream("designersupported"));
assertToken(TokenType.DESIGNERSUPPORTED, "designersupported", 0, 17, new Position(1, 0), new Position(1, 17),
lexer.nextToken());
}
@Test
public void testWordToken() {
QMLDirectoryLexer lexer = new QMLDirectoryLexer();
lexer.setInput(createInputStream("QtQuick.Control"));
assertToken(TokenType.WORD, "QtQuick.Control", 0, 15, new Position(1, 0), new Position(1, 15),
lexer.nextToken());
}
@Test
public void testWordTokenContainsKeyword() {
QMLDirectoryLexer lexer = new QMLDirectoryLexer();
lexer.setInput(createInputStream("plugins.test"));
assertToken(TokenType.WORD, "plugins.test", 0, 12, new Position(1, 0), new Position(1, 12), lexer.nextToken());
}
@Test
public void testWordTokenAsRelativePath() {
QMLDirectoryLexer lexer = new QMLDirectoryLexer();
lexer.setInput(createInputStream("./test/something/"));
assertToken(TokenType.WORD, "./test/something/", 0, 17, new Position(1, 0), new Position(1, 17),
lexer.nextToken());
}
@Test
public void testWordTokenAsAbsoluteWindowsPath() {
QMLDirectoryLexer lexer = new QMLDirectoryLexer();
lexer.setInput(createInputStream("C:\\Users\\someone\\test\\something\\"));
assertToken(TokenType.WORD, "C:\\Users\\someone\\test\\something\\", 0, 32, new Position(1, 0),
new Position(1, 32), lexer.nextToken());
}
@Test
public void testWordTokenAsAbsoluteUnixPath() {
QMLDirectoryLexer lexer = new QMLDirectoryLexer();
lexer.setInput(createInputStream("/usr/local/test/something/"));
assertToken(TokenType.WORD, "/usr/local/test/something/", 0, 26, new Position(1, 0), new Position(1, 26),
lexer.nextToken());
}
@Test
public void testDecimalToken() {
QMLDirectoryLexer lexer = new QMLDirectoryLexer();
lexer.setInput(createInputStream("2.3"));
assertToken(TokenType.DECIMAL, "2.3", 0, 3, new Position(1, 0), new Position(1, 3), lexer.nextToken());
}
@Test
public void testIntegerToken() {
QMLDirectoryLexer lexer = new QMLDirectoryLexer();
lexer.setInput(createInputStream("3"));
assertToken(TokenType.INTEGER, "3", 0, 1, new Position(1, 0), new Position(1, 1), lexer.nextToken());
}
@Test
public void testWhitespaceToken() {
QMLDirectoryLexer lexer = new QMLDirectoryLexer();
lexer.setInput(createInputStream(" \t\n"));
assertToken(TokenType.WHITESPACE, " \t", 0, 2, new Position(1, 0), new Position(1, 2), lexer.nextToken(false));
}
@Test
public void testCommandEndToken() {
QMLDirectoryLexer lexer = new QMLDirectoryLexer();
lexer.setInput(createInputStream("\n"));
assertToken(TokenType.COMMAND_END, "\\n", 0, 1, new Position(1, 0), new Position(1, 1), lexer.nextToken());
}
@Test
public void testEOFToken() {
QMLDirectoryLexer lexer = new QMLDirectoryLexer();
lexer.setInput(createInputStream(""));
assertToken(TokenType.EOF, "", 0, 0, new Position(1, 0), new Position(1, 0), lexer.nextToken());
}
@Test
public void testEOFTokenAfterCommand() {
QMLDirectoryLexer lexer = new QMLDirectoryLexer();
lexer.setInput(createInputStream("\n"));
lexer.nextToken();
assertToken(TokenType.EOF, "", 1, 1, new Position(2, 0), new Position(2, 0), lexer.nextToken());
}
}

View file

@ -1,309 +0,0 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.qt.core.tests;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import org.eclipse.cdt.internal.qt.core.location.Position;
import org.eclipse.cdt.qt.core.location.IPosition;
import org.eclipse.cdt.qt.core.qmldir.IQDirAST;
import org.eclipse.cdt.qt.core.qmldir.IQDirASTNode;
import org.eclipse.cdt.qt.core.qmldir.IQDirClassnameCommand;
import org.eclipse.cdt.qt.core.qmldir.IQDirCommentCommand;
import org.eclipse.cdt.qt.core.qmldir.IQDirDependsCommand;
import org.eclipse.cdt.qt.core.qmldir.IQDirDesignerSupportedCommand;
import org.eclipse.cdt.qt.core.qmldir.IQDirInternalCommand;
import org.eclipse.cdt.qt.core.qmldir.IQDirModuleCommand;
import org.eclipse.cdt.qt.core.qmldir.IQDirPluginCommand;
import org.eclipse.cdt.qt.core.qmldir.IQDirResourceCommand;
import org.eclipse.cdt.qt.core.qmldir.IQDirSingletonCommand;
import org.eclipse.cdt.qt.core.qmldir.IQDirSyntaxError;
import org.eclipse.cdt.qt.core.qmldir.IQDirTypeInfoCommand;
import org.eclipse.cdt.qt.core.qmldir.QMLDirectoryParser;
import org.eclipse.cdt.qt.core.qmldir.QMLDirectoryParser.SyntaxError;
import org.junit.Test;
@SuppressWarnings("nls")
public class QMLDirectoryParserTests {
public void assertLocation(int start, int end, IPosition locStart, IPosition locEnd, IQDirASTNode node) {
// Check position offsets
assertEquals("Unexpected start position", start, node.getStart());
assertEquals("Unexpected end position", end, node.getEnd());
// Check SourceLocation start
assertEquals("Unexpected location start line", locStart.getLine(), node.getLocation().getStart().getLine());
assertEquals("Unexpected location start column", locStart.getColumn(),
node.getLocation().getStart().getColumn());
}
private InputStream createInputStream(String s) {
return new ByteArrayInputStream(s.getBytes());
}
@Test
public void testModuleCommand() {
QMLDirectoryParser parser = new QMLDirectoryParser();
IQDirAST ast = parser.parse(createInputStream("module QtQuick.Controls\n"), false);
assertEquals("Unexpected command list size", 1, ast.getCommands().size());
assertThat("Unexpected command", ast.getCommands().get(0), instanceOf(IQDirModuleCommand.class));
IQDirModuleCommand mod = (IQDirModuleCommand) ast.getCommands().get(0);
assertEquals("Unexpected qualified ID", "QtQuick.Controls", mod.getModuleIdentifier().getText());
assertLocation(0, 24, new Position(1, 0), new Position(1, 24), mod);
}
@Test
public void testModuleNoIdentifier() {
try {
QMLDirectoryParser parser = new QMLDirectoryParser();
parser.parse(createInputStream("module\n"), false);
fail("Parser did not throw SyntaxError");
} catch (SyntaxError e) {
assertEquals("Unexpected token '\\n' (1:6)", e.getMessage());
}
}
@Test
public void testSingletonCommand() {
QMLDirectoryParser parser = new QMLDirectoryParser();
IQDirAST ast = parser.parse(createInputStream("singleton Singleton 2.3 Singleton.qml\n"), false);
assertEquals("Unexpected command list size", 1, ast.getCommands().size());
assertThat("Unexpected command", ast.getCommands().get(0), instanceOf(IQDirSingletonCommand.class));
IQDirSingletonCommand singleton = (IQDirSingletonCommand) ast.getCommands().get(0);
assertEquals("Unexpected type name", "Singleton", singleton.getTypeName().getText());
assertEquals("Unexpected initial version", "2.3", singleton.getInitialVersion().getVersionString());
assertEquals("Unexpected file name", "Singleton.qml", singleton.getFile().getText());
assertLocation(0, 38, new Position(1, 0), new Position(1, 38), singleton);
}
@Test
public void testInvalidVersionNumber() {
try {
QMLDirectoryParser parser = new QMLDirectoryParser();
parser.parse(createInputStream("singleton Singleton 2 Singleton.qml\n"), false);
fail("Parser did not throw SyntaxError");
} catch (SyntaxError e) {
assertEquals("Unexpected token '2' (1:20)", e.getMessage());
}
}
@Test
public void testInternalCommand() {
QMLDirectoryParser parser = new QMLDirectoryParser();
IQDirAST ast = parser.parse(createInputStream("internal MyPrivateType MyPrivateType.qml\n"), false);
assertEquals("Unexpected command list size", 1, ast.getCommands().size());
assertThat("Unexpected command", ast.getCommands().get(0), instanceOf(IQDirInternalCommand.class));
IQDirInternalCommand internal = (IQDirInternalCommand) ast.getCommands().get(0);
assertEquals("Unexpected type name", "MyPrivateType", internal.getTypeName().getText());
assertEquals("Unexpected file name", "MyPrivateType.qml", internal.getFile().getText());
assertLocation(0, 41, new Position(1, 0), new Position(1, 41), internal);
}
@Test
public void testResourceCommand() {
QMLDirectoryParser parser = new QMLDirectoryParser();
IQDirAST ast = parser.parse(createInputStream("MyScript 1.0 MyScript.qml\n"), false);
assertEquals("Unexpected command list size", 1, ast.getCommands().size());
assertThat("Unexpected command", ast.getCommands().get(0), instanceOf(IQDirResourceCommand.class));
IQDirResourceCommand resource = (IQDirResourceCommand) ast.getCommands().get(0);
assertEquals("Unexpected type name", "MyScript", resource.getResourceIdentifier().getText());
assertEquals("Unexpected initial version", "1.0", resource.getInitialVersion().getVersionString());
assertEquals("Unexpected file name", "MyScript.qml", resource.getFile().getText());
assertLocation(0, 26, new Position(1, 0), new Position(1, 26), resource);
}
@Test
public void testPluginCommand() {
QMLDirectoryParser parser = new QMLDirectoryParser();
IQDirAST ast = parser.parse(createInputStream("plugin MyPluginLibrary\n"), false);
assertEquals("Unexpected command list size", 1, ast.getCommands().size());
assertThat("Unexpected command", ast.getCommands().get(0), instanceOf(IQDirPluginCommand.class));
IQDirPluginCommand plugin = (IQDirPluginCommand) ast.getCommands().get(0);
assertEquals("Unexpected identifier", "MyPluginLibrary", plugin.getName().getText());
assertEquals("Unexpected path", null, plugin.getPath());
assertLocation(0, 23, new Position(1, 0), new Position(1, 23), plugin);
}
@Test
public void testPluginCommandWithPath() {
QMLDirectoryParser parser = new QMLDirectoryParser();
IQDirAST ast = parser.parse(createInputStream("plugin MyPluginLibrary ./lib/\n"), false);
assertEquals("Unexpected command list size", 1, ast.getCommands().size());
assertThat("Unexpected command", ast.getCommands().get(0), instanceOf(IQDirPluginCommand.class));
IQDirPluginCommand plugin = (IQDirPluginCommand) ast.getCommands().get(0);
assertEquals("Unexpected identifier", "MyPluginLibrary", plugin.getName().getText());
assertEquals("Unexpected path", "./lib/", plugin.getPath().getText());
assertLocation(0, 30, new Position(1, 0), new Position(1, 30), plugin);
}
@Test
public void testClassnameCommand() {
QMLDirectoryParser parser = new QMLDirectoryParser();
IQDirAST ast = parser.parse(createInputStream("classname MyClass\n"), false);
assertEquals("Unexpected command list size", 1, ast.getCommands().size());
assertThat("Unexpected command", ast.getCommands().get(0), instanceOf(IQDirClassnameCommand.class));
IQDirClassnameCommand classname = (IQDirClassnameCommand) ast.getCommands().get(0);
assertEquals("Unexpected class name", "MyClass", classname.getIdentifier().getText());
assertLocation(0, 18, new Position(1, 0), new Position(1, 18), classname);
}
@Test
public void testTypeInfoCommand() {
QMLDirectoryParser parser = new QMLDirectoryParser();
IQDirAST ast = parser.parse(createInputStream("typeinfo mymodule.qmltypes\n"), false);
assertEquals("Unexpected command list size", 1, ast.getCommands().size());
assertThat("Unexpected command", ast.getCommands().get(0), instanceOf(IQDirTypeInfoCommand.class));
IQDirTypeInfoCommand typeinfo = (IQDirTypeInfoCommand) ast.getCommands().get(0);
assertEquals("Unexpected file name", "mymodule.qmltypes", typeinfo.getFile().getText());
assertLocation(0, 27, new Position(1, 0), new Position(1, 27), typeinfo);
}
@Test
public void testDependsCommand() {
QMLDirectoryParser parser = new QMLDirectoryParser();
IQDirAST ast = parser.parse(createInputStream("depends MyOtherModule 1.0\n"), false);
assertEquals("Unexpected command list size", 1, ast.getCommands().size());
assertThat("Unexpected command", ast.getCommands().get(0), instanceOf(IQDirDependsCommand.class));
IQDirDependsCommand depends = (IQDirDependsCommand) ast.getCommands().get(0);
assertEquals("Unexpected module identifier", "MyOtherModule", depends.getModuleIdentifier().getText());
assertEquals("Unexpected initial version", "1.0", depends.getInitialVersion().getVersionString());
assertLocation(0, 26, new Position(1, 0), new Position(1, 26), depends);
}
@Test
public void testDesignerSupportedCommand() {
QMLDirectoryParser parser = new QMLDirectoryParser();
IQDirAST ast = parser.parse(createInputStream("designersupported\n"), false);
assertEquals("Unexpected command list size", 1, ast.getCommands().size());
assertThat("Unexpected command", ast.getCommands().get(0), instanceOf(IQDirDesignerSupportedCommand.class));
assertLocation(0, 18, new Position(1, 0), new Position(1, 18), ast.getCommands().get(0));
}
@Test
public void testCommentCommand() {
QMLDirectoryParser parser = new QMLDirectoryParser();
IQDirAST ast = parser.parse(createInputStream("# This is a comment command\n"), false);
assertEquals("Unexpected command list size", 1, ast.getCommands().size());
assertThat("Unexpected command", ast.getCommands().get(0), instanceOf(IQDirCommentCommand.class));
IQDirCommentCommand comment = (IQDirCommentCommand) ast.getCommands().get(0);
assertEquals("Unexpected text", "# This is a comment command", comment.getText());
}
@Test
public void testSyntaxErrorCommand() {
QMLDirectoryParser parser = new QMLDirectoryParser();
IQDirAST ast = parser.parse(createInputStream("classname"));
assertEquals("Unexpected command list size", 1, ast.getCommands().size());
assertThat("Unexpected command", ast.getCommands().get(0), instanceOf(IQDirSyntaxError.class));
IQDirSyntaxError err = (IQDirSyntaxError) ast.getCommands().get(0);
assertEquals("Unexpected message", "Unexpected token 'EOF' (1:9)", err.getSyntaxError().getMessage());
assertLocation(0, 9, new Position(1, 0), new Position(1, 9), err);
}
@Test
public void testSyntaxErrorCommandIncludesWholeLine() {
QMLDirectoryParser parser = new QMLDirectoryParser();
IQDirAST ast = parser.parse(createInputStream("classname class extra\n"));
assertEquals("Unexpected command list size", 1, ast.getCommands().size());
assertThat("Unexpected command", ast.getCommands().get(0), instanceOf(IQDirSyntaxError.class));
IQDirSyntaxError err = (IQDirSyntaxError) ast.getCommands().get(0);
assertEquals("Unexpected message", "Expected token '\\n' or 'EOF', but saw 'extra' (1:16)",
err.getSyntaxError().getMessage());
assertLocation(0, 22, new Position(1, 0), new Position(1, 22), err);
}
@Test
public void testExampleQMLDirFile() {
QMLDirectoryParser parser = new QMLDirectoryParser();
IQDirAST ast = parser.parse(createInputStream("module QtQuick\n" + "plugin qtquick2plugin\n"
+ "classname QtQuick2Plugin\n" + "typeinfo plugins.qmltypes\n" + "designersupported\n"));
assertEquals("Unexpected command list size", 5, ast.getCommands().size());
// Module Command (index 0)
assertThat("Unexpected command", ast.getCommands().get(0), instanceOf(IQDirModuleCommand.class));
IQDirModuleCommand mod = (IQDirModuleCommand) ast.getCommands().get(0);
assertEquals("Unexpected module qualified ID", "QtQuick", mod.getModuleIdentifier().getText());
// Plugin Command (index 1)
assertThat("Unexpected command", ast.getCommands().get(1), instanceOf(IQDirPluginCommand.class));
IQDirPluginCommand plugin = (IQDirPluginCommand) ast.getCommands().get(1);
assertEquals("Unexpected plugin identifier", "qtquick2plugin", plugin.getName().getText());
assertEquals("Unexpected plugin path", null, plugin.getPath());
// Classname Command (index 2)
assertThat("Unexpected command", ast.getCommands().get(2), instanceOf(IQDirClassnameCommand.class));
IQDirClassnameCommand classname = (IQDirClassnameCommand) ast.getCommands().get(2);
assertEquals("Unexpected class name", "QtQuick2Plugin", classname.getIdentifier().getText());
// Type Info Command (index 3)
assertThat("Unexpected command", ast.getCommands().get(3), instanceOf(IQDirTypeInfoCommand.class));
IQDirTypeInfoCommand typeinfo = (IQDirTypeInfoCommand) ast.getCommands().get(3);
assertEquals("Unexpected type info file name", "plugins.qmltypes", typeinfo.getFile().getText());
// Designer Supported Command (index 4)
assertThat("Unexpected command", ast.getCommands().get(4), instanceOf(IQDirDesignerSupportedCommand.class));
}
@Test
public void testExampleQMLDirFileWithError() {
QMLDirectoryParser parser = new QMLDirectoryParser();
IQDirAST ast = parser.parse(createInputStream("module QtQuick\n" + "plugin qtquick2plugin\n"
+ "classnames QtQuick2Plugin\n" + "typeinfo plugins.qmltypes\n" + "designersupported\n"));
assertEquals("Unexpected command list size", 5, ast.getCommands().size());
// Module Command (index 0)
assertThat("Unexpected command", ast.getCommands().get(0), instanceOf(IQDirModuleCommand.class));
IQDirModuleCommand mod = (IQDirModuleCommand) ast.getCommands().get(0);
assertEquals("Unexpected module qualified ID", "QtQuick", mod.getModuleIdentifier().getText());
// Plugin Command (index 1)
assertThat("Unexpected command", ast.getCommands().get(1), instanceOf(IQDirPluginCommand.class));
IQDirPluginCommand plugin = (IQDirPluginCommand) ast.getCommands().get(1);
assertEquals("Unexpected plugin identifier", "qtquick2plugin", plugin.getName().getText());
assertEquals("Unexpected plugin path", null, plugin.getPath());
// Syntax Error Command (index 2)
assertThat("Unexpected command", ast.getCommands().get(2), instanceOf(IQDirSyntaxError.class));
IQDirSyntaxError err = (IQDirSyntaxError) ast.getCommands().get(2);
assertEquals("Unexpected error message", "Unexpected token 'QtQuick2Plugin' (3:11)",
err.getSyntaxError().getMessage());
// Type Info Command (index 3)
assertThat("Unexpected command", ast.getCommands().get(3), instanceOf(IQDirTypeInfoCommand.class));
IQDirTypeInfoCommand typeinfo = (IQDirTypeInfoCommand) ast.getCommands().get(3);
assertEquals("Unexpected type info file name", "plugins.qmltypes", typeinfo.getFile().getText());
// Designer Supported Command (index 4)
assertThat("Unexpected command", ast.getCommands().get(4), instanceOf(IQDirDesignerSupportedCommand.class));
}
@Test
public void testParseTwoDifferentStreams() {
QMLDirectoryParser parser = new QMLDirectoryParser();
// Parse module QtQuick.Controls
IQDirAST ast = parser.parse(createInputStream("module QtQuick.Controls\n"), false);
assertEquals("Unexpected command list size", 1, ast.getCommands().size());
assertThat("Unexpected command", ast.getCommands().get(0), instanceOf(IQDirModuleCommand.class));
IQDirModuleCommand mod = (IQDirModuleCommand) ast.getCommands().get(0);
assertEquals("Unexpected qualified ID", "QtQuick.Controls", mod.getModuleIdentifier().getText());
assertLocation(0, 24, new Position(1, 0), new Position(1, 24), mod);
// Parse a second module MyModule
ast = parser.parse(createInputStream("module MyModule\n"), false);
assertEquals("Unexpected command list size", 1, ast.getCommands().size());
assertThat("Unexpected command", ast.getCommands().get(0), instanceOf(IQDirModuleCommand.class));
mod = (IQDirModuleCommand) ast.getCommands().get(0);
assertEquals("Unexpected qualified ID", "MyModule", mod.getModuleIdentifier().getText());
assertLocation(0, 16, new Position(1, 0), new Position(1, 16), mod);
}
}

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.cdt.qt.core</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>

View file

@ -1,2 +0,0 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8

View file

@ -1,486 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
org.eclipse.jdt.core.builder.invalidClasspath=abort
org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch, *.xtend
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.mainOnlyProjectHasTestOnlyDependency=error
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error
org.eclipse.jdt.core.codeComplete.argumentPrefixes=
org.eclipse.jdt.core.codeComplete.argumentSuffixes=
org.eclipse.jdt.core.codeComplete.fieldPrefixes=
org.eclipse.jdt.core.codeComplete.fieldSuffixes=
org.eclipse.jdt.core.codeComplete.localPrefixes=
org.eclipse.jdt.core.codeComplete.localSuffixes=
org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=error
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false
org.eclipse.jdt.core.formatter.align_with_spaces=false
org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0
org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_module_statements=16
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0
org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true
org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true
org.eclipse.jdt.core.formatter.comment.format_block_comments=false
org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=true
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
org.eclipse.jdt.core.formatter.comment.format_line_comments=false
org.eclipse.jdt.core.formatter.comment.format_source_code=true
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
org.eclipse.jdt.core.formatter.comment.indent_root_tags=false
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
org.eclipse.jdt.core.formatter.comment.line_length=80
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
org.eclipse.jdt.core.formatter.compact_else_if=true
org.eclipse.jdt.core.formatter.continuation_indentation=2
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_empty_lines=false
org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=4
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.join_lines_in_comments=true
org.eclipse.jdt.core.formatter.join_wrapped_lines=true
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false
org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false
org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.jdt.core.formatter.lineSplit=120
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=4
org.eclipse.jdt.core.formatter.use_on_off_tags=true
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false
org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true
org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
org.eclipse.jdt.core.incompleteClasspath=error
org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter

View file

@ -1,3 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.launching.PREF_COMPILER_COMPLIANCE_DOES_NOT_MATCH_JRE=warning
org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning

View file

@ -1,213 +0,0 @@
cleanup.add_all=false
cleanup.add_default_serial_version_id=true
cleanup.add_generated_serial_version_id=false
cleanup.add_missing_annotations=true
cleanup.add_missing_deprecated_annotations=true
cleanup.add_missing_methods=false
cleanup.add_missing_nls_tags=false
cleanup.add_missing_override_annotations=true
cleanup.add_missing_override_annotations_interface_methods=true
cleanup.add_serial_version_id=false
cleanup.always_use_blocks=true
cleanup.always_use_parentheses_in_expressions=false
cleanup.always_use_this_for_non_static_field_access=false
cleanup.always_use_this_for_non_static_method_access=false
cleanup.array_with_curly=false
cleanup.arrays_fill=false
cleanup.bitwise_conditional_expression=false
cleanup.boolean_literal=false
cleanup.boolean_value_rather_than_comparison=false
cleanup.break_loop=false
cleanup.collection_cloning=false
cleanup.comparing_on_criteria=false
cleanup.comparison_statement=false
cleanup.controlflow_merge=false
cleanup.convert_functional_interfaces=false
cleanup.convert_to_enhanced_for_loop=false
cleanup.convert_to_enhanced_for_loop_if_loop_var_used=true
cleanup.convert_to_switch_expressions=false
cleanup.correct_indentation=false
cleanup.do_while_rather_than_while=true
cleanup.double_negation=false
cleanup.else_if=false
cleanup.embedded_if=false
cleanup.evaluate_nullable=false
cleanup.extract_increment=false
cleanup.format_source_code=true
cleanup.format_source_code_changes_only=false
cleanup.hash=false
cleanup.if_condition=false
cleanup.insert_inferred_type_arguments=false
cleanup.instanceof=false
cleanup.instanceof_keyword=false
cleanup.invert_equals=false
cleanup.join=false
cleanup.lazy_logical_operator=false
cleanup.make_local_variable_final=true
cleanup.make_parameters_final=false
cleanup.make_private_fields_final=true
cleanup.make_type_abstract_if_missing_method=false
cleanup.make_variable_declarations_final=false
cleanup.map_cloning=false
cleanup.merge_conditional_blocks=false
cleanup.multi_catch=false
cleanup.never_use_blocks=false
cleanup.never_use_parentheses_in_expressions=true
cleanup.no_string_creation=false
cleanup.no_super=false
cleanup.number_suffix=false
cleanup.objects_equals=false
cleanup.one_if_rather_than_duplicate_blocks_that_fall_through=false
cleanup.operand_factorization=false
cleanup.organize_imports=true
cleanup.overridden_assignment=false
cleanup.plain_replacement=false
cleanup.precompile_regex=false
cleanup.primitive_comparison=false
cleanup.primitive_parsing=false
cleanup.primitive_rather_than_wrapper=false
cleanup.primitive_serialization=false
cleanup.pull_out_if_from_if_else=false
cleanup.pull_up_assignment=false
cleanup.push_down_negation=false
cleanup.qualify_static_field_accesses_with_declaring_class=false
cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
cleanup.qualify_static_member_accesses_with_declaring_class=false
cleanup.qualify_static_method_accesses_with_declaring_class=false
cleanup.reduce_indentation=false
cleanup.redundant_comparator=false
cleanup.redundant_falling_through_block_end=false
cleanup.remove_private_constructors=true
cleanup.remove_redundant_modifiers=false
cleanup.remove_redundant_semicolons=true
cleanup.remove_redundant_type_arguments=true
cleanup.remove_trailing_whitespaces=true
cleanup.remove_trailing_whitespaces_all=true
cleanup.remove_trailing_whitespaces_ignore_empty=false
cleanup.remove_unnecessary_array_creation=false
cleanup.remove_unnecessary_casts=true
cleanup.remove_unnecessary_nls_tags=false
cleanup.remove_unused_imports=true
cleanup.remove_unused_local_variables=false
cleanup.remove_unused_method_parameters=false
cleanup.remove_unused_private_fields=true
cleanup.remove_unused_private_members=false
cleanup.remove_unused_private_methods=true
cleanup.remove_unused_private_types=true
cleanup.return_expression=false
cleanup.simplify_lambda_expression_and_method_ref=false
cleanup.single_used_field=false
cleanup.sort_members=false
cleanup.sort_members_all=false
cleanup.standard_comparison=false
cleanup.static_inner_class=false
cleanup.strictly_equal_or_different=false
cleanup.stringbuffer_to_stringbuilder=false
cleanup.stringbuilder=false
cleanup.stringbuilder_for_local_vars=true
cleanup.stringconcat_to_textblock=false
cleanup.substring=false
cleanup.switch=false
cleanup.system_property=false
cleanup.system_property_boolean=false
cleanup.system_property_file_encoding=false
cleanup.system_property_file_separator=false
cleanup.system_property_line_separator=false
cleanup.system_property_path_separator=false
cleanup.ternary_operator=false
cleanup.try_with_resource=false
cleanup.unlooped_while=false
cleanup.unreachable_block=false
cleanup.use_anonymous_class_creation=false
cleanup.use_autoboxing=false
cleanup.use_blocks=false
cleanup.use_blocks_only_for_return_and_throw=false
cleanup.use_directly_map_method=false
cleanup.use_lambda=true
cleanup.use_parentheses_in_expressions=false
cleanup.use_string_is_blank=false
cleanup.use_this_for_non_static_field_access=false
cleanup.use_this_for_non_static_field_access_only_if_necessary=true
cleanup.use_this_for_non_static_method_access=false
cleanup.use_this_for_non_static_method_access_only_if_necessary=true
cleanup.use_unboxing=false
cleanup.use_var=false
cleanup.useless_continue=false
cleanup.useless_return=false
cleanup.valueof_rather_than_instantiation=false
cleanup_profile=_CDT
cleanup_settings_version=2
eclipse.preferences.version=1
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
formatter_profile=_CDT
formatter_settings_version=14
internal.default.compliance=user
org.eclipse.jdt.ui.exception.name=e
org.eclipse.jdt.ui.gettersetter.use.is=true
org.eclipse.jdt.ui.ignorelowercasenames=true
org.eclipse.jdt.ui.importorder=java;javax;org;com;
org.eclipse.jdt.ui.keywordthis=false
org.eclipse.jdt.ui.ondemandthreshold=1000
org.eclipse.jdt.ui.overrideannotation=true
org.eclipse.jdt.ui.staticondemandthreshold=1000
org.eclipse.jdt.ui.text.custom_code_templates=
sp_cleanup.add_default_serial_version_id=true
sp_cleanup.add_generated_serial_version_id=false
sp_cleanup.add_missing_annotations=true
sp_cleanup.add_missing_deprecated_annotations=true
sp_cleanup.add_missing_methods=false
sp_cleanup.add_missing_nls_tags=false
sp_cleanup.add_missing_override_annotations=true
sp_cleanup.add_missing_override_annotations_interface_methods=true
sp_cleanup.add_serial_version_id=false
sp_cleanup.always_use_blocks=true
sp_cleanup.always_use_parentheses_in_expressions=false
sp_cleanup.always_use_this_for_non_static_field_access=false
sp_cleanup.always_use_this_for_non_static_method_access=false
sp_cleanup.convert_functional_interfaces=false
sp_cleanup.convert_to_enhanced_for_loop=false
sp_cleanup.correct_indentation=false
sp_cleanup.format_source_code=true
sp_cleanup.format_source_code_changes_only=false
sp_cleanup.insert_inferred_type_arguments=false
sp_cleanup.make_local_variable_final=true
sp_cleanup.make_parameters_final=false
sp_cleanup.make_private_fields_final=true
sp_cleanup.make_type_abstract_if_missing_method=false
sp_cleanup.make_variable_declarations_final=false
sp_cleanup.never_use_blocks=false
sp_cleanup.never_use_parentheses_in_expressions=true
sp_cleanup.on_save_use_additional_actions=true
sp_cleanup.organize_imports=true
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
sp_cleanup.remove_private_constructors=true
sp_cleanup.remove_redundant_modifiers=false
sp_cleanup.remove_redundant_semicolons=true
sp_cleanup.remove_redundant_type_arguments=true
sp_cleanup.remove_trailing_whitespaces=true
sp_cleanup.remove_trailing_whitespaces_all=true
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
sp_cleanup.remove_unnecessary_casts=true
sp_cleanup.remove_unnecessary_nls_tags=false
sp_cleanup.remove_unused_imports=true
sp_cleanup.remove_unused_local_variables=false
sp_cleanup.remove_unused_private_fields=true
sp_cleanup.remove_unused_private_members=false
sp_cleanup.remove_unused_private_methods=true
sp_cleanup.remove_unused_private_types=true
sp_cleanup.sort_members=false
sp_cleanup.sort_members_all=false
sp_cleanup.use_anonymous_class_creation=false
sp_cleanup.use_blocks=false
sp_cleanup.use_blocks_only_for_return_and_throw=false
sp_cleanup.use_lambda=true
sp_cleanup.use_parentheses_in_expressions=false
sp_cleanup.use_this_for_non_static_field_access=false
sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
sp_cleanup.use_this_for_non_static_method_access=false
sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true

View file

@ -1,184 +0,0 @@
ANNOTATION_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
ANNOTATION_ELEMENT_TYPE_ADDED_FIELD=Error
ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error
ANNOTATION_ELEMENT_TYPE_ADDED_METHOD=Error
ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error
ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
ANNOTATION_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
ANNOTATION_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error
ANNOTATION_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error
ANNOTATION_ELEMENT_TYPE_CHANGED_TO_CLASS=Error
ANNOTATION_ELEMENT_TYPE_CHANGED_TO_ENUM=Error
ANNOTATION_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error
ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
ANNOTATION_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
ANNOTATION_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITHOUT_DEFAULT_VALUE=Error
ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITH_DEFAULT_VALUE=Error
ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error
API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
API_USE_SCAN_FIELD_SEVERITY=Error
API_USE_SCAN_METHOD_SEVERITY=Error
API_USE_SCAN_TYPE_SEVERITY=Error
CLASS_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
CLASS_ELEMENT_TYPE_ADDED_FIELD=Error
CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error
CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
CLASS_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERCLASS_SET=Error
CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
CLASS_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
CLASS_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error
CLASS_ELEMENT_TYPE_CHANGED_SUPERCLASS=Error
CLASS_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error
CLASS_ELEMENT_TYPE_CHANGED_TO_ENUM=Error
CLASS_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error
CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
CLASS_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error
CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error
CONSTRUCTOR_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error
CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
CONSTRUCTOR_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
CONSTRUCTOR_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
CONSTRUCTOR_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
CONSTRUCTOR_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error
CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
CONSTRUCTOR_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
CONSTRUCTOR_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error
CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error
ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
ENUM_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error
ENUM_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error
ENUM_ELEMENT_TYPE_CHANGED_TO_CLASS=Error
ENUM_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error
ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENTS=Error
FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
ILLEGAL_EXTEND=Warning
ILLEGAL_IMPLEMENT=Warning
ILLEGAL_INSTANTIATE=Warning
ILLEGAL_OVERRIDE=Warning
ILLEGAL_REFERENCE=Warning
INTERFACE_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
INTERFACE_ELEMENT_TYPE_ADDED_DEFAULT_METHOD=Error
INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error
INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
INTERFACE_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error
INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETERS=Error
INTERFACE_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error
INTERFACE_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error
INTERFACE_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error
INTERFACE_ELEMENT_TYPE_CHANGED_TO_CLASS=Error
INTERFACE_ELEMENT_TYPE_CHANGED_TO_ENUM=Error
INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
INTERFACE_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error
INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
INVALID_ANNOTATION=Ignore
INVALID_JAVADOC_TAG=Error
INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning
LEAK_EXTEND=Warning
LEAK_FIELD_DECL=Warning
LEAK_IMPLEMENT=Warning
LEAK_METHOD_PARAM=Warning
LEAK_METHOD_RETURN_TYPE=Warning
METHOD_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error
METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
METHOD_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
METHOD_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
METHOD_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error
METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
METHOD_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error
METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error
MISSING_EE_DESCRIPTIONS=Warning
TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
UNUSED_PROBLEM_FILTERS=Warning
automatically_removed_unused_problem_filters=false
changed_execution_env=Error
eclipse.preferences.version=1
incompatible_api_component_version=Error
incompatible_api_component_version_include_major_without_breaking_change=Disabled
incompatible_api_component_version_include_minor_without_api_change=Disabled
incompatible_api_component_version_report_major_without_breaking_change=Warning
incompatible_api_component_version_report_minor_without_api_change=Warning
invalid_since_tag_version=Error
malformed_since_tag=Error
missing_since_tag=Error
report_api_breakage_when_major_version_incremented=Disabled
report_resolution_errors_api_component=Warning

View file

@ -1,35 +0,0 @@
compilers.f.unresolved-features=1
compilers.f.unresolved-plugins=1
compilers.incompatible-environment=1
compilers.p.build=1
compilers.p.build.bin.includes=1
compilers.p.build.encodings=2
compilers.p.build.java.compiler=2
compilers.p.build.java.compliance=1
compilers.p.build.missing.output=2
compilers.p.build.output.library=1
compilers.p.build.source.library=1
compilers.p.build.src.includes=1
compilers.p.deprecated=1
compilers.p.discouraged-class=1
compilers.p.internal=1
compilers.p.missing-packages=2
compilers.p.missing-version-export-package=2
compilers.p.missing-version-import-package=2
compilers.p.missing-version-require-bundle=2
compilers.p.no-required-att=0
compilers.p.no.automatic.module=1
compilers.p.not-externalized-att=1
compilers.p.service.component.without.lazyactivation=1
compilers.p.unknown-attribute=1
compilers.p.unknown-class=1
compilers.p.unknown-element=1
compilers.p.unknown-identifier=1
compilers.p.unknown-resource=1
compilers.p.unresolved-ex-points=0
compilers.p.unresolved-import=0
compilers.s.create-docs=false
compilers.s.doc-folder=doc
compilers.s.open-tags=1
compilers.use-project=true
eclipse.preferences.version=1

View file

@ -1,40 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.qt.core;singleton:=true
Bundle-Version: 2.4.0.qualifier
Bundle-Activator: org.eclipse.cdt.internal.qt.core.Activator
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources,
org.eclipse.core.expressions;bundle-version="[3.2.0,4.0.0)",
org.eclipse.cdt.core,
org.eclipse.cdt.codan.core,
org.eclipse.cdt.codan.core.cxx,
org.eclipse.core.filesystem,
org.eclipse.launchbar.core;bundle-version="1.0.1",
org.eclipse.remote.core;bundle-version="2.0.0",
org.eclipse.debug.core;bundle-version="3.10.0",
org.eclipse.cdt.debug.core,
org.freemarker;bundle-version="2.3.22",
org.eclipse.cdt.dsf.gdb;bundle-version="5.0.0",
org.eclipse.cdt.dsf;bundle-version="2.6.0",
org.eclipse.tools.templates.freemarker;bundle-version="1.0.0",
org.eclipse.cdt.build.gcc.core;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Export-Package: org.eclipse.cdt.internal.qt.core;x-friends:="org.eclipse.cdt.qt.ui,org.eclipse.cdt.qt.ui.tests",
org.eclipse.cdt.internal.qt.core.build;x-friends:="org.eclipse.cdt.qt.ui",
org.eclipse.cdt.internal.qt.core.index;x-friends:="org.eclipse.cdt.qt.ui.tests",
org.eclipse.cdt.internal.qt.core.location;x-friends:="org.eclipse.cdt.qt.core.tests",
org.eclipse.cdt.internal.qt.core.parser;x-friends:="org.eclipse.cdt.qt.ui",
org.eclipse.cdt.internal.qt.core.project;x-friends:="org.eclipse.cdt.qt.ui",
org.eclipse.cdt.internal.qt.core.qmldir;x-friends:="org.eclipse.cdt.qt.core.tests",
org.eclipse.cdt.qt.core,
org.eclipse.cdt.qt.core.location,
org.eclipse.cdt.qt.core.qmldir,
org.eclipse.cdt.qt.core.qmljs
Import-Package: javax.xml.bind;version="[2.3.3,3.0.0)"
Automatic-Module-Name: org.eclipse.cdt.qt.core

View file

@ -1,38 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>About</title>
</head>
<body lang="EN-US">
<h2>About This Content</h2>
<p>November 30, 2017</p>
<h3>License</h3>
<p>
The Eclipse Foundation makes available all content in this plug-in
(&quot;Content&quot;). Unless otherwise indicated below, the Content
is provided to you under the terms and conditions of the Eclipse
Public License Version 2.0 (&quot;EPL&quot;). A copy of the EPL is
available at <a href="https://www.eclipse.org/legal/epl-2.0">https://www.eclipse.org/legal/epl-2.0</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.
</p>
<p>
If you did not receive this Content directly from the Eclipse
Foundation, the Content is being redistributed by another party
(&quot;Redistributor&quot;) and different terms and conditions may
apply to your use of any object code in the Content. Check the
Redistributor's license that was provided with the Content. If no such
license exists, contact the Redistributor. Unless otherwise indicated
below, the terms and conditions of the EPL still apply to any source
code in the Content and such source code may be obtained at <a
href="https://www.eclipse.org/">https://www.eclipse.org</a>.
</p>
</body>
</html>

View file

@ -1 +0,0 @@
/node_modules

View file

@ -1,84 +0,0 @@
#!/usr/bin/env node
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
var path = require("path");
var fs = require("fs");
var acorn = require("..");
var infile, parsed, tokens, options = {}, silent = false, compact = false, tokenize = false;
function help(status) {
var print = (status == 0) ? console.log : console.error;
print("usage: " + path.basename(process.argv[1]) + "[--ecma3|--ecma5|--ecma6]");
print(" [--tokenize] [--locations] [---allow-hash-bang] [--compact] [--silent] [--module] [--help] [--] infile");
process.exit(status);
}
for (var i = 2; i < process.argv.length; ++i) {
var arg = process.argv[i];
if (arg[0] != "-" && !infile) infile = arg;
else if (arg == "--" && !infile && i + 2 == process.argv.length)
infile = process.argv[++i];
else if (arg == "--ecma3")
options.ecmaVersion = 3;
else if (arg == "--ecma5")
options.ecmaVersion = 5;
else if (arg == "--ecma6")
options.ecmaVersion = 6;
else if (arg == "--ecma7")
options.ecmaVersion = 7;
else if (arg == "--locations")
options.locations = true;
else if (arg == "--allow-hash-bang")
options.allowHashBang = true;
else if (arg == "--silent")
silent = true;
else if (arg == "--compact")
compact = true;
else if (arg == "--help")
help(0);
else if (arg == "--tokenize")
tokenize = true;
else if (arg == "--module")
options.sourceType = 'module';
else
help(1);
}
// Enable qml parser
options.plugins = { qml: true }
try {
var code = fs.readFileSync(infile, "utf8");
if (!tokenize)
parsed = acorn.parse(code, options);
else {
var get = acorn.tokenize(code, options);
tokens = [];
while (true) {
var token = get();
tokens.push(token);
if (token.type.type == "eof")
break;
}
}
} catch(e) {
console.log(e.message);
process.exit(1);
}
if (!silent)
console.log(JSON.stringify(tokenize ? tokens : parsed, null, compact ? null : 2));

View file

@ -1,24 +0,0 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
(function (mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
return mod(require("./inject.js"), require("acorn"));
if (typeof define == "function" && define.amd) // AMD
return define(["./inject.js", "acorn/dist/acorn"], mod);
mod(acornQMLInjector, acorn); // Plain browser env
})(function (acornQMLInjector, acorn) {
'use strict';
acornQMLInjector.inject(acorn);
});

View file

@ -1,653 +0,0 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
(function (root, mod) {
if (typeof exports === "object" && typeof module === "object") // CommonJS
return mod(exports);
if (typeof define === "function" && define.amd) // AMD
return define(["exports"], mod);
mod(root.acornQMLInjector || (root.acornQMLInjector = {})); // Plain browser env
})(this, function (exports) {
'use strict';
exports.inject = function (acorn) {
// Add the 'mode' option to acorn
acorn.defaultOptions.mode = "qml";
// Acorn token types
var tt = acorn.tokTypes;
// QML token types
var qtt = acorn.qmlTokTypes = {};
var keywords = acorn.qmlKeywords = {};
/*
* Shorthand for defining keywords in the 'keywords' variable with the following
* format:
* keywords[name].isPrimitive : if this is a primitive type
* keywords[name].isQMLContextual : if this is a contextual keyword for QML
*
* Also stores the token's name in qtt._<keyword> for easy referencing later. None
* of these keywords will be tokenized and, as such, are allowed to be used in
* JavaScript expressions by acorn. The 'isQMLContextual' boolean in keywords refers
* to those contextual keywords that are also contextual in QML's parser rules such
* as 'color', 'list', 'alias', etc.
*/
function kw(name, options) {
if (options === undefined)
options = {};
qtt["_" + name] = name;
keywords[name] = {};
keywords[name].isPrimitive = options.isPrimitive ? true : false;
keywords[name].isQMLContextual = options.isQMLContextual ? true : false;
}
// QML keywords
kw("import");
kw("pragma");
kw("property", { isQMLContextual: true });
kw("readonly", { isQMLContextual: true });
kw("signal", { isQMLContextual: true });
kw("as");
kw("on", { isQMLContextual: true });
kw("boolean", { isPrimitive: true });
kw("double", { isPrimitive: true });
kw("int", { isPrimitive: true });
kw("alias", { isPrimitive: true, isQMLContextual: true });
kw("list", { isPrimitive: true, isQMLContextual: true });
kw("color", { isPrimitive: true, isQMLContextual: true });
kw("real", { isPrimitive: true, isQMLContextual: true });
kw("string", { isPrimitive: true, isQMLContextual: true });
kw("url", { isPrimitive: true, isQMLContextual: true });
// Future reserved words
kw("transient");
kw("synchronized");
kw("abstract");
kw("volatile");
kw("native");
kw("goto");
kw("byte");
kw("long");
kw("char");
kw("short");
kw("float");
// QML parser methods
var pp = acorn.Parser.prototype;
/*
* Parses a set of QML Header Items (QMLImport or QMLPragma)
*/
pp.qml_parseHeaderItemList = function () {
var node = this.startNode();
node.items = [];
var loop = true;
while (loop) {
if (this.isContextual(qtt._import)) {
node.items.push(this.qml_parseImport());
} else if (this.isContextual(qtt._pragma)) {
node.items.push(this.qml_parsePragma());
} else {
loop = false;
}
}
return this.finishNode(node, "QMLHeaderItemList");
};
/*
* Parses a QML Pragma statement of the form:
* 'pragma' <QMLQualifiedID>
*/
pp.qml_parsePragma = function () {
var node = this.startNode();
this.expectContextual(qtt._pragma);
node.id = this.qml_parseQualifiedId(true);
this.semicolon();
return this.finishNode(node, "QMLPragma");
};
/*
* Parses a QML Import of the form:
* 'import' <QMLModule> [as <QMLQualifier>]
* 'import' <StringLiteral> [as <QMLQualifier>]
*
* as specified by http://doc.qt.io/qt-5/qtqml-syntax-imports.html
*/
pp.qml_parseImport = function () {
var node = this.startNode();
if (!this.eatContextual(qtt._import)) {
this.unexpected();
}
switch (this.type) {
case tt.name:
node.module = this.qml_parseModule();
node.directory = null;
break;
case tt.string:
node.module = null;
node.directory = this.parseLiteral(this.value);
break;
default:
this.unexpected();
}
// Parse the qualifier, if any
if (this.isContextual(qtt._as)) {
node.qualifier = this.qml_parseQualifier();
}
this.semicolon();
return this.finishNode(node, "QMLImport");
};
/*
* Parses a QML Module of the form:
* <QMLQualifiedId> <QMLVersionLiteral>
*/
pp.qml_parseModule = function () {
var node = this.startNode();
node.id = this.qml_parseQualifiedId(false);
if (this.type === tt.num) {
node.version = this.qml_parseVersionLiteral();
} else {
this.unexpected();
}
return this.finishNode(node, "QMLModule");
};
/*
* Parses a QML Version Literal which consists of a major and minor
* version separated by a '.'
*/
pp.qml_parseVersionLiteral = function () {
var node = this.startNode();
node.value = this.value;
node.raw = this.input.slice(this.start, this.end);
if (!(/(\d+)\.(\d+)/.exec(node.raw))) {
this.raise(this.start, "QML module must specify major and minor version");
}
this.next();
return this.finishNode(node, "QMLVersionLiteral");
};
/*
* Parses a QML Qualifier of the form:
* 'as' <Identifier>
*/
pp.qml_parseQualifier = function () {
var node = this.startNode();
this.expectContextual(qtt._as);
node.id = this.qml_parseIdent(false);
return this.finishNode(node, "QMLQualifier");
};
/*
* Parses a QML Object Definition of the form:
* <QMLQualifiedId> { (<QMLObjectMember>)* }
*
* http://doc.qt.io/qt-5/qtqml-syntax-basics.html#object-declarations
*/
pp.qml_parseObjectDefinition = function (node, isBinding) {
if (!node) {
node = this.startNode();
}
if (!node.id) {
node.id = this.qml_parseQualifiedId(false);
}
node.body = this.qml_parseObjectInitializer();
return this.finishNode(node, isBinding ? "QMLObjectBinding" : "QMLObjectDefinition");
};
/*
* Parses a QML Object Initializer of the form:
* '{' <QMLObjectMember>* '}'
*/
pp.qml_parseObjectInitializer = function () {
var node = this.startNode();
this.expect(tt.braceL);
node.members = [];
while (this.type !== tt.braceR) {
node.members.push(this.qml_parseObjectMember());
}
this.expect(tt.braceR);
return this.finishNode(node, "QMLObjectInitializer");
};
/*
* Parses a QML Object Member which can be one of the following:
* - a QML Property Binding
* - a QML Property Declaration
* - a QML Property Modifier
* - a QML Object Literal
* - a JavaScript Function Declaration
* - a QML Signal Definition
*/
pp.qml_parseObjectMember = function () {
if (this.type === tt._default || this.isContextual(qtt._readonly) || this.isContextual(qtt._property)) {
return this.qml_parsePropertyDeclaration();
} else if (this.isContextual(qtt._signal)) {
return this.qml_parseSignalDefinition();
} else if (this.type === tt._function) {
return this.qml_parseFunctionMember();
}
return this.qml_parseObjectDefinitionOrPropertyBinding();
};
/*
* Parses a JavaScript function as a member of a QML Object Literal
*/
pp.qml_parseFunctionMember = function () {
var node = this.startNode();
this.expect(tt._function);
return this.parseFunction(node, true);
};
/*
* Parses a QML Object Definition or Property Binding depending on the tokens found.
*/
pp.qml_parseObjectDefinitionOrPropertyBinding = function (node) {
if (!node) {
node = this.startNode();
}
if (!node.id) {
node.id = this.qml_parseQualifiedId(false);
}
switch (this.type) {
case tt.braceL:
return this.qml_parseObjectDefinition(node);
case tt.colon:
return this.qml_parsePropertyBinding(node);
}
this.unexpected();
};
/*
* Parses a QML Property Modifier of the form:
* <QMLQualifiedID> 'on' <QMLQualifiedID> <QMLInitializer>
* TODO: Call this method in the normal parser once we can do lookahead
* Without lookahead, telling the difference between an Object Declaration,
* Property Binding, and Property Modifier would be too difficult. For now,
* we've implemented a workaround for Object Declarations and Property Bindings
* until Acorn gets lookahead.
*/
pp.qml_parsePropertyModifier = function () {
var node = this.startNode();
node.kind = this.qml_parseQualifiedID(false);
this.expectContextual(qtt._on);
node.id = this.qml_parseQualifiedID(false);
node.body = this.qml_parseObjectInitializer();
return this.finishNode(node, "QMLPropertyModifier");
};
/*
* Parses a QML Property Binding of the form:
* <QMLQualifiedID> <QMLBinding>
*/
pp.qml_parsePropertyBinding = function (node) {
if (!node) {
node = this.startNode();
}
if (!node.id) {
node.id = this.qml_parseQualifiedId(false);
}
this.expect(tt.colon);
node.binding = this.qml_parseBinding();
return this.finishNode(node, "QMLPropertyBinding");
};
/*
* Parses a QML Signal Definition of the form:
* 'signal' <Identifier> [(<QMLPropertyType> <Identifier> [',' <QMLPropertyType> <Identifier>]* )]?
*/
pp.qml_parseSignalDefinition = function () {
var node = this.startNode();
// Parse as a qualified id in case this is not a signal definition
var signal = this.qml_parseQualifiedId(true);
if (signal.parts.length === 1) {
if (signal.name !== qtt._signal) {
this.unexpected();
}
if (this.type === tt.colon || this.type === tt.braceL) {
// This is a property binding or object literal
node.id = signal;
return this.qml_parseObjectDefinitionOrPropertyBinding(node);
}
} else {
// Signal keyword is a qualified ID. This is not a signal definition
node.id = signal;
return this.qml_parseObjectDefinitionOrPropertyBinding(node);
}
node.id = this.qml_parseIdent(false);
this.qml_parseSignalParams(node);
this.semicolon();
return this.finishNode(node, "QMLSignalDefinition");
};
/*
* Parses QML Signal Parameters of the form:
* [(<QMLPropertyType> <Identifier> [',' <QMLPropertyType> <Identifier>]* )]?
*/
pp.qml_parseSignalParams = function (node) {
node.params = [];
if (this.eat(tt.parenL)) {
if (!this.eat(tt.parenR)) {
do {
var param = this.startNode();
param.kind = this.qml_parsePropertyType();
param.id = this.qml_parseIdent(false);
node.params.push(this.finishNode(param, "QMLParameter"));
} while (this.eat(tt.comma));
this.expect(tt.parenR);
}
}
};
/*
* Parses a QML Property Declaration of the form:
* ['default'|'readonly'] 'property' <QMLType> <Identifier> [<QMLBinding>]
*/
pp.qml_parsePropertyDeclaration = function () {
var node = this.startNode();
// Parse 'default' or 'readonly'
node.default = false;
node.readonly = false;
if (this.eat(tt._default)) {
node.default = true;
} else if (this.isContextual(qtt._readonly)) {
// Parse as a qualified id in case this is not a property declaration
var readonly = this.qml_parseQualifiedId(true);
if (readonly.parts.length === 1) {
if (this.type === tt.colon || this.type === tt.braceL) {
// This is a property binding or object literal.
node.id = readonly;
return this.qml_parseObjectDefinitionOrPropertyBinding(node);
}
node.readonly = true;
} else {
// Readonly keyword is a qualified ID. This is not a property declaration.
node.id = readonly;
return this.qml_parseObjectDefinitionOrPropertyBinding(node);
}
}
// Parse as a qualified id in case this is not a property declaration
var property = this.qml_parseQualifiedId(true);
if (property.parts.length === 1 || node.default || node.readonly) {
if (property.name !== qtt._property) {
this.unexpected();
}
if (this.type === tt.colon || this.type === tt.braceL) {
// This is a property binding or object literal.
node.default = undefined;
node.readonly = undefined;
node.id = property;
return this.qml_parseObjectDefinitionOrPropertyBinding(node);
}
} else {
// Property keyword is a qualified ID. This is not a property declaration.
node.default = undefined;
node.readonly = undefined;
node.id = property;
return this.qml_parseObjectDefinitionOrPropertyBinding(node);
}
node.kind = this.qml_parsePropertyType();
if (this.value === "<") {
this.expect(tt.relational); // '<'
node.modifier = this.qml_parsePropertyType();
if (this.value !== ">") {
this.unexpected();
}
this.expect(tt.relational); // '>'
}
node.id = this.qml_parseIdent(false);
if (!this.eat(tt.colon)) {
node.binding = null;
this.semicolon();
} else {
node.binding = this.qml_parseBinding();
}
return this.finishNode(node, "QMLPropertyDeclaration");
};
/*
* Parses a QML Property Type of the form:
* <Identifier>
*/
pp.qml_parsePropertyType = function () {
var node = this.startNode();
node.primitive = false;
if (this.qml_isPrimitiveType(this.type, this.value)) {
node.primitive = true;
}
node.id = this.qml_parseIdent(true);
return this.finishNode(node, "QMLPropertyType");
};
/*
* Parses one of the following possibilities for a QML Property assignment:
* - QML Object Binding
* - QML Array Binding
* - QML Script Binding
*/
pp.qml_parseBinding = function () {
if (this.options.mode === "qmltypes") {
return this.qml_parseScriptBinding(false);
}
// TODO: solve ambiguity where a QML Object Literal starts with a
// Qualified Id that looks very similar to a MemberExpression in
// JavaScript. For now, we just won't parse statements like:
// test: QMLObject { }
// test: QMLObject.QualifiedId { }
return this.qml_parseScriptBinding(true);
};
/*
* Parses a QML Array Binding of the form:
* '[' [<QMLObjectDefinition> (',' <QMLObjectDefinition>)*] ']'
*
* TODO: call this in the parser once we can use lookahead to distinguish between
* a QML Array Binding and a JavaScript array.
*/
pp.qml_parseArrayBinding = function () {
var node = this.startNode();
this.expect(tt.bracketL);
node.members = [];
while (!this.eat(tt.bracketR)) {
node.members.push(this.qml_parseObjectDefinition());
}
return this.finishNode(node, "QMLArrayBinding");
};
/*
* Parses one of the following Script Bindings:
* - Single JavaScript Expression
* - QML Statement Block (A block of JavaScript statements)
*/
pp.qml_parseScriptBinding = function (allowStatementBlock) {
var node = this.startNode();
node.block = false;
if (allowStatementBlock && this.type === tt.braceL) {
node.block = true;
node.script = this.qml_parseStatementBlock();
} else {
node.script = this.parseExpression(false);
this.semicolon();
}
return this.finishNode(node, "QMLScriptBinding");
};
/*
* Parses a QML Statement Block of the form:
* { <Statement>* }
*/
pp.qml_parseStatementBlock = function () {
var node = this.startNode();
this.expect(tt.braceL);
node.body = [];
while (!this.eat(tt.braceR)) {
node.body.push(this.parseStatement(true, false));
}
return this.finishNode(node, "QMLStatementBlock");
};
/*
* Parses a Qualified ID of the form:
* <Identifier> ('.' <Identifier>)*
*
* If 'liberal' is true then this method will allow non-contextual QML keywords as
* identifiers.
*/
pp.qml_parseQualifiedId = function (liberal) {
var node = this.startNode();
node.parts = [];
node.parts.push(this.qml_parseIdent(liberal));
while (this.eat(tt.dot)) {
node.parts.push(this.qml_parseIdent(liberal));
}
node.name = "";
for (var i = 0; i < node.parts.length; i++) {
node.name += node.parts[i].name;
if (i < node.parts.length - 1) {
node.name += ".";
}
}
return this.finishNode(node, "QMLQualifiedID");
};
/*
* Parses an Identifier in a QML Context. That is, this method uses 'isQMLContextual'
* to throw an error if a non-contextual QML keyword is found.
*
* If 'liberal' is true then this method will allow non-contextual QML keywords as
* identifiers.
*/
pp.qml_parseIdent = function (liberal) {
// Check for non-contextual QML keywords
if (!liberal) {
if (!this.qml_isIdent(this.type, this.value)) {
this.unexpected();
}
}
return this.parseIdent(liberal);
};
/*
* Returns whether or not a given token type and name can be a QML Identifier.
* Uses the 'isQMLContextual' boolean of 'keywords' to determine this.
*/
pp.qml_isIdent = function (type, name) {
if (type === tt.name) {
var key;
if ((key = keywords[name])) {
return key.isQMLContextual;
}
return true;
}
return false;
};
/*
* Returns whether or not the current token is a QML primitive type and consumes
* it as a side effect if it is.
*/
pp.qml_eatPrimitiveType = function (type, name) {
if (this.qml_isPrimitiveType(type, name)) {
this.next();
return true;
}
return false;
};
/*
* Returns whether or not the current token is a QML primitive type.
*/
pp.qml_isPrimitiveType = function (type, name) {
if (name === "var") {
return true;
}
if (type === tt.name) {
var key;
if ((key = keywords[name])) {
return key.isPrimitive;
}
}
return false;
};
acorn.plugins.qml = function (instance) {
// Extend acorn's 'parseTopLevel' method
instance.extend("parseTopLevel", function (nextMethod) {
return function (node) {
// Make parsing simpler by only allowing ECMA Version 5 or older ('import' is
// not a keyword in this version of ECMA Script). Qt 5.5 runs with ECMA Script
// 5 anyway, so this makes sense.
if (!this.options.ecmaVersion || this.options.ecmaVersion > 5) {
throw new Error("QML only supports ECMA Script Language Specification 5 or older");
}
// Disabled 'qmltypes' mode for now since the normal parser can't parse it anyway
if (this.options.mode === "qml") {
// Force strict mode
this.strict = true;
// Most of QML's constructs sit at the top-level of the parse tree,
// replacing JavaScripts top-level. Here we are parsing such things
// as the root object literal and header statements of QML. Eventually,
// these rules will delegate down to JavaScript expressions.
node.mode = this.options.mode;
node.headerItemList = this.qml_parseHeaderItemList();
node.rootObject = null;
if (this.type !== tt.eof) {
node.rootObject = this.qml_parseObjectDefinition();
}
if (!this.eat(tt.eof)) {
this.raise(this.pos, "Expected EOF after QML Root Object");
}
return this.finishNode(node, "QMLProgram");
} else if (this.options.mode === "js") {
return nextMethod.call(this, node);
} else {
throw new Error("Unknown mode '" + this.options.mode + "'");
}
};
});
};
return acorn;
};
});

View file

@ -1,24 +0,0 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
(function (mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
return mod(require("./inject.js"), require("acorn"), require("acorn/dist/acorn_loose"));
if (typeof define == "function" && define.amd) // AMD
return define(["./inject.js", "acorn", "acorn/dist/acorn_loose"], mod);
mod(acornQMLLooseInjector, acorn, acorn); // Plain browser env
})(function (acornQMLLooseInjector, acorn, acorn_loose) {
"use strict";
acornQMLLooseInjector.inject(acorn);
});

View file

@ -1,681 +0,0 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
// This will only be visible globally if we are in a browser environment
var injectQMLLoose;
(function (root, mod) {
if (typeof exports === "object" && typeof module === "object") // CommonJS
return mod(module.exports);
if (typeof define === "function" && define.amd) // AMD
return define(["exports"], mod);
mod(root.acornQMLLooseInjector || (root.acornQMLLooseInjector = {})); // Plain browser env
})(this, function (exports) {
"use strict";
exports.inject = function (acorn) {
// Acorn token types
var tt = acorn.tokTypes;
// QML token types
var qtt = acorn.qmlTokTypes;
var keywords = acorn.qmlKeywords;
// QML parser methods
var lp = acorn.LooseParser.prototype;
var pp = acorn.Parser.prototype;
/*
* Parses a set of QML Header Items (QMLImport or QMLPragma)
*/
lp.qml_parseHeaderItemList = function () {
var node = this.startNode();
node.items = [];
var loop = true;
while (loop) {
if (this.isContextual(qtt._import)) {
node.items.push(this.qml_parseImport());
} else if (this.isContextual(qtt._pragma)) {
node.items.push(this.qml_parsePragma());
} else {
loop = false;
}
}
return this.finishNode(node, "QMLHeaderItemList");
};
/*
* Parses a QML Pragma statement of the form:
* 'pragma' <QMLQualifiedID>
*/
lp.qml_parsePragma = function () {
var node = this.startNode();
this.expectContextual(qtt._pragma);
node.id = this.qml_parseQualifiedId(true);
this.semicolon();
return this.finishNode(node, "QMLPragma");
};
/*
* Parses a QML Import of the form:
* 'import' <QMLModule> [as <QMLQualifier>]
* 'import' <StringLiteral> [as <QMLQualifier>]
*
* as specified by http://doc.qt.io/qt-5/qtqml-syntax-imports.html
*/
lp.qml_parseImport = function () {
var node = this.startNode();
this.expectContextual(qtt._import);
switch (this.tok.type) {
case tt.string:
node.module = null;
node.directory = this.parseExprAtom();
break;
default:
node.module = this.qml_parseModule();
node.directory = null;
break;
}
// Parse the qualifier, if any
if (this.isContextual(qtt._as)) {
node.qualifier = this.qml_parseQualifier();
}
this.semicolon();
return this.finishNode(node, "QMLImport");
};
/*
* Parses a QML Module of the form:
* <QMLQualifiedId> <QMLVersionLiteral>
*/
lp.qml_parseModule = function () {
var node = this.startNode();
node.id = this.qml_parseQualifiedId(false);
node.version = this.qml_parseVersionLiteral();
return this.finishNode(node, "QMLModule");
};
/*
* Parses a QML Version Literal which consists of a major and minor
* version separated by a '.'
*/
lp.qml_parseVersionLiteral = function () {
var node = this.startNode();
var matches;
if (this.tok.type === tt.num) {
node.raw = this.input.slice(this.tok.start, this.tok.end);
node.value = this.tok.value;
this.next();
} else {
node.value = 0;
node.raw = "0.0";
}
return this.finishNode(node, "QMLVersionLiteral");
};
/*
* Parses a QML Qualifier of the form:
* 'as' <Identifier>
*/
lp.qml_parseQualifier = function () {
var node = this.startNode();
this.expectContextual(qtt._as);
node.id = this.qml_parseIdent(false);
return this.finishNode(node, "QMLQualifier");
};
/*
* Parses a QML Object Definition of the form:
* <QMLQualifiedId> { (<QMLObjectMember>)* }
*
* http://doc.qt.io/qt-5/qtqml-syntax-basics.html#object-declarations
*/
lp.qml_parseObjectDefinition = function (isBinding) {
var node = this.startNode();
node.id = this.qml_parseQualifiedId(false);
node.body = this.qml_parseObjectInitializer();
return this.finishNode(node, isBinding ? "QMLObjectBinding" : "QMLObjectDefinition");
};
/*
* Parses a QML Object Initializer of the form:
* '{' <QMLObjectMember>* '}'
*/
lp.qml_parseObjectInitializer = function () {
var node = this.startNode();
this.pushCx();
this.expect(tt.braceL);
var blockIndent = this.curIndent,
line = this.curLineStart;
node.members = [];
while (!this.closes(tt.braceR, blockIndent, line, true)) {
var member = this.qml_parseObjectMember();
if (member) {
node.members.push(member);
}
}
this.popCx();
this.eat(tt.braceR);
return this.finishNode(node, "QMLObjectInitializer");
};
/*
* Parses a QML Object Member which can be one of the following:
* - a QML Property Binding
* - a QML Property Declaration
* - a QML Property Modifier
* - a QML Object Literal
* - a JavaScript Function Declaration
* - a QML Signal Definition
*/
lp.qml_parseObjectMember = function () {
if (this.tok.type === tt._default || this.isContextual(qtt._readonly) || this.isContextual(qtt._property) || this.qml_isPrimitiveType(this.tok.type, this.tok.value)) {
return this.qml_parsePropertyDeclaration();
} else if (this.isContextual(qtt._signal)) {
return this.qml_parseSignalDefinition();
} else if (this.tok.type === tt._function) {
return this.qml_parseFunctionMember();
} else if (this.qml_isIdent(this.tok.type, this.tok.value) || this.tok.type === tt.dot) {
var la = this.lookAhead(1);
if (this.qml_isIdent(la.type, la.value) && la.value !== qtt._on) {
// Two identifiers in a row means this is most likely a property declaration
// with the 'property' token missing.
return this.qml_parsePropertyDeclaration();
} else {
return this.qml_parseMemberStartsWithIdentifier() || this.qml_parsePropertyBinding();
}
} else if (this.tok.type === tt.colon) {
return this.qml_parsePropertyBinding();
} else if (this.tok.type === tt.braceL) {
return this.qml_parseObjectDefinition();
}
// ignore the current token if it didn't pass the previous tests
this.next();
};
/*
* Parses a QML Object Member that starts with an identifier. This method solves the
* ambiguities that arise from QML having multiple Object Members that start with
* Qualified IDs as well as the fact that several of its keywords can be used as part
* of these Qualified IDs.
*/
lp.qml_parseMemberStartsWithIdentifier = function () {
// Jump past the potential Qualified ID
var i = 1,
la = this.tok;
if (this.qml_isIdent(la.type, la.value)) {
la = this.lookAhead(i++);
}
while (la.type === tt.dot) {
la = this.lookAhead(i++);
if (this.qml_isIdent(la.type, la.value)) {
la = this.lookAhead(i++);
}
}
// Check the last lookahead token
switch (la.type) {
case tt.braceL:
return this.qml_parseObjectDefinition();
case tt.colon:
return this.qml_parsePropertyBinding();
case tt.name:
if (la.value === qtt._on) {
return this.qml_parsePropertyModifier();
}
break;
}
return null;
};
/*
* Parses a JavaScript function as a member of a QML Object Literal
*/
lp.qml_parseFunctionMember = function () {
var node = this.startNode();
this.expect(tt._function);
return this.qml_parseFunction(node, true);
};
/*
* QML version of 'parseFunction' needed to have proper error tolerant parsing
* for QML member functions versus their JavaScript counterparts. The main
* difference between the two functions is that this implementation will not
* forcefully insert '(' and '{' tokens for the body and parameters. Instead,
* it will silently create an empty parameter list or body and let parsing
* continue normally.
*/
lp.qml_parseFunction = function (node, isStatement) {
this.initFunction(node);
if (this.tok.type === tt.name) node.id = this.parseIdent();
else if (isStatement) node.id = this.dummyIdent();
node.params = this.tok.type === tt.parenL ? this.parseFunctionParams() : [];
if (this.tok.type === tt.braceL) {
node.body = this.parseBlock();
} else {
if (this.options.locations) {
node.body = this.startNodeAt([this.last.end, this.last.loc.end]);
} else {
node.body = this.startNodeAt(this.last.end);
}
node.body.body = [];
this.finishNode(node.body, "BlockStatement");
}
return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression");
};
/*
* Parses a QML Property Modifier of the form:
* <QMLQualifiedID> 'on' <QMLQualifiedID> <QMLInitializer>
*/
lp.qml_parsePropertyModifier = function () {
var node = this.startNode();
node.kind = this.qml_parseQualifiedId(false);
this.expectContextual(qtt._on);
node.id = this.qml_parseQualifiedId(false);
node.body = this.qml_parseObjectInitializer();
return this.finishNode(node, "QMLPropertyModifier");
};
/*
* Parses a QML Property of the form:
* <QMLQualifiedID> <QMLBinding>
*/
lp.qml_parsePropertyBinding = function () {
var node = this.startNode();
node.id = this.qml_parseQualifiedId(false);
var start = this.storeCurrentPos();
this.expect(tt.colon);
node.binding = this.qml_parseBinding(start);
return this.finishNode(node, "QMLPropertyBinding");
};
/*
* Parses a QML Signal Definition of the form:
* 'signal' <Identifier> [(<QMLPropertyType> <Identifier> [',' <QMLPropertyType> <Identifier>]* )]?
*/
lp.qml_parseSignalDefinition = function () {
var node = this.startNode();
// Check if this is an object literal or property binding first
var objOrBind = this.qml_parseMemberStartsWithIdentifier();
if (objOrBind) {
return objOrBind;
}
this.expectContextual(qtt._signal);
node.id = this.qml_parseIdent(false);
this.qml_parseSignalParams(node);
this.semicolon();
return this.finishNode(node, "QMLSignalDefinition");
};
/*
* Checks if the given node is a dummy identifier
*/
function isDummy(node) {
return node.name === "✖";
}
/*
* Parses QML Signal Parameters of the form:
* [(<QMLPropertyType> <Identifier> [',' <QMLPropertyType> <Identifier>]* )]?
*/
lp.qml_parseSignalParams = function (node) {
this.pushCx();
var indent = this.curIndent,
line = this.curLineStart;
node.params = [];
if (this.eat(tt.parenL)) {
while (!this.closes(tt.parenR, indent + 1, line) && this.tok.type !== tt.braceR) {
var param = this.startNode();
param.kind = this.qml_parsePropertyType();
// Break out of an infinite loop where we continously consume dummy ids
if (isDummy(param.kind.id) && this.tok.type !== tt.comma) {
break;
}
param.id = this.qml_parseIdent(false);
node.params.push(this.finishNode(param, "QMLParameter"));
// Break out of an infinite loop where we continously consume dummy ids
if (isDummy(param.id) && this.tok.type !== tt.comma) {
break;
}
this.eat(tt.comma);
}
this.popCx();
if (!this.eat(tt.parenR)) {
// If there is no closing brace, make the node span to the start
// of the next token (this is useful for Tern)
this.last.end = this.tok.start;
if (this.options.locations) this.last.loc.end = this.tok.loc.start;
}
}
};
/*
* Parses a QML Property Declaration of the form:
* ['default'|'readonly'] 'property' <QMLType> <Identifier> [<QMLBinding>]
*/
lp.qml_parsePropertyDeclaration = function () {
var node = this.startNode();
var objOrBind = null;
// Parse 'default' or 'readonly'
node.default = false;
node.readonly = false;
if (this.eat(tt._default)) {
node.default = true;
} else if (this.isContextual(qtt._readonly)) {
objOrBind = this.qml_parseMemberStartsWithIdentifier();
if (objOrBind) {
objOrBind.default = undefined;
objOrBind.readonly = undefined;
return objOrBind;
}
this.expectContextual(qtt._readonly);
node.readonly = true;
}
if (!node.default && !node.readonly) {
objOrBind = this.qml_parseMemberStartsWithIdentifier();
if (objOrBind) {
return objOrBind;
}
this.expectContextual(qtt._property);
} else {
this.expectContextual(qtt._property);
}
node.kind = this.qml_parsePropertyType();
if (this.tok.value === "<") {
this.expect(tt.relational); // '<'
node.modifier = this.qml_parsePropertyType();
this.expect(tt.relational); // '>'
}
node.id = this.qml_parseIdent(false);
var start = this.storeCurrentPos();
if (this.eat(tt.colon)) {
node.binding = this.qml_parseBinding(start);
} else {
node.binding = null;
this.semicolon();
}
return this.finishNode(node, "QMLPropertyDeclaration");
};
/*
* Parses a QML Property Type of the form:
* <Identifier>
*/
lp.qml_parsePropertyType = function () {
var node = this.startNode();
node.primitive = false;
if (this.qml_isPrimitiveType(this.tok.type, this.tok.value)) {
node.primitive = true;
}
node.id = this.qml_parseIdent(true);
return this.finishNode(node, "QMLPropertyType");
};
/*
* Parses one of the following possibilities for a QML Property assignment:
* - QML Object Binding
* - QML Array Binding
* - QML Script Binding
*/
lp.qml_parseBinding = function (start) {
var i, la;
if (this.options.mode === "qmltypes") {
return this.qml_parseScriptBinding(start, false);
}
if (this.tok.type === tt.braceL) {
return this.qml_parseScriptBinding(start, true);
} else if (this.tok.type === tt.bracketL) {
// Perform look ahead to determine whether this is an expression or
// a QML Array Binding
i = 1;
la = this.lookAhead(i++);
if (la.type === tt.name) {
while (la.type === tt.dot || la.type === tt.name) {
la = this.lookAhead(i++);
}
if (la.type === tt.braceL) {
return this.qml_parseArrayBinding();
}
}
return this.qml_parseScriptBinding(start, true);
}
// Perform look ahead to determine whether this is an expression or
// a QML Object Literal
i = 1;
la = this.tok;
if (this.qml_isIdent(la.type, la.value)) {
la = this.lookAhead(i++);
}
while (la.type === tt.dot) {
la = this.lookAhead(i++);
if (this.qml_isIdent(la.type, la.value)) {
la = this.lookAhead(i++);
}
}
if (la.type === tt.braceL) {
return this.qml_parseObjectDefinition(true);
} else {
return this.qml_parseScriptBinding(start, true);
}
};
/*
* Parses a QML Array Binding of the form:
* '[' [<QMLObjectDefinition> (',' <QMLObjectDefinition>)*] ']'
*/
lp.qml_parseArrayBinding = function () {
var node = this.startNode();
var indent = this.curIndent,
line = this.curLineStart;
this.pushCx();
this.expect(tt.bracketL);
node.elements = [];
while (!this.closes(tt.bracketR, indent + 1, line) && this.tok.type !== tt.braceR) {
var obj = this.qml_parseObjectDefinition();
node.elements.push(obj);
// Break out of an infinite loop where we continously consume dummy ids
if (isDummy(obj.id) && this.tok.type !== tt.comma) {
break;
}
this.eat(tt.comma);
}
this.popCx();
if (!this.eat(tt.bracketR)) {
// If there is no closing brace, make the node span to the start
// of the next token (this is useful for Tern)
this.last.end = this.tok.start;
if (this.options.locations) this.last.loc.end = this.tok.loc.start;
}
return this.finishNode(node, "QMLArrayBinding");
};
/*
* Parses one of the following Script Bindings:
* - Single JavaScript Expression
* - QML Statement Block (A block of JavaScript statements)
*/
lp.qml_parseScriptBinding = function (start, allowStatementBlock) {
// Help out Tern a little by starting the Script Binding at the end of
// the colon token (only if we consume invalid syntax).
var node = this.startNodeAt(start);
node.block = false;
if (allowStatementBlock && this.tok.type === tt.braceL) {
node.block = true;
node.script = this.qml_parseStatementBlock();
} else {
node.script = this.parseExpression(false);
this.semicolon();
}
// If this node consumed valid syntax, reset its start position
if (node.script.type !== "Identifier" || node.script.name !== "✖") {
if (node.loc) {
node.loc.start = node.script.loc.start;
}
if (node.range) {
node.range = node.script.range;
}
node.start = node.script.start;
node.end = node.script.end;
}
return this.finishNode(node, "QMLScriptBinding");
};
/*
* Parses a QML Statement Block of the form:
* { <Statement>* }
*/
lp.qml_parseStatementBlock = function () {
var node = this.startNode();
this.pushCx();
this.expect(tt.braceL);
var blockIndent = this.curIndent,
line = this.curLineStart;
node.body = [];
while (!this.closes(tt.braceR, blockIndent, line, true)) {
node.body.push(this.parseStatement(true, false));
}
this.popCx();
this.eat(tt.braceR);
return this.finishNode(node, "QMLStatementBlock");
};
/*
* Parses a Qualified ID of the form:
* <Identifier> ('.' <Identifier>)*
*
* If 'liberal' is true then this method will allow non-contextual QML keywords as
* identifiers.
*/
lp.qml_parseQualifiedId = function (liberal) {
var node = this.startNode();
node.parts = [];
node.parts.push(this.qml_parseIdent(liberal));
while (this.eat(tt.dot)) {
node.parts.push(this.qml_parseIdent(liberal));
}
node.name = "";
for (var i = 0; i < node.parts.length; i++) {
node.name += node.parts[i].name;
if (i < node.parts.length - 1) {
node.name += ".";
}
}
return this.finishNode(node, "QMLQualifiedID");
};
/*
* Parses an Identifier in a QML Context. That is, this method uses 'isQMLContextual'
* to throw an error if a non-contextual QML keyword is found.
*
* If 'liberal' is true then this method will allow non-contextual QML keywords as
* identifiers.
*/
lp.qml_parseIdent = function (liberal) {
// Check for non-contextual QML keywords
if (!liberal) {
if (!this.qml_isIdent(this.tok.type, this.tok.value)) {
return this.dummyIdent();
}
}
return this.parseIdent();
};
/*
* Checks the next token to see if it matches the given contextual keyword. If the
* contextual keyword was not found, this function looks ahead at the next two tokens
* and jumps ahead if it was found there. Returns whether or not the keyword was found.
*/
lp.expectContextual = function (name) {
if (this.eatContextual(name)) return true;
for (var i = 1; i <= 2; i++) {
if (this.lookAhead(i).type == tt.name && this.lookAhead(i).value === name) {
for (var j = 0; j < i; j++) this.next();
return true;
}
}
};
// Functions left un-changed from the main parser
lp.qml_isIdent = pp.qml_isIdent;
lp.qml_eatPrimitiveType = pp.qml_eatPrimitiveType;
lp.qml_isPrimitiveType = pp.qml_isPrimitiveType;
acorn.pluginsLoose.qml = function (instance) {
// Extend acorn's 'parseTopLevel' method
instance.extend("parseTopLevel", function (nextMethod) {
return function () {
// Make parsing simpler by only allowing ECMA Version 5 or older ('import' is
// not a keyword in this version of ECMA Script). Qt 5.5 runs with ECMA Script
// 5 anyway, so this makes sense.
if (!this.options.ecmaVersion || this.options.ecmaVersion > 5) {
throw new Error("QML only supports ECMA Script Language Specification 5 or older");
}
if (this.options.mode === "qml" || this.options.mode === "qmltypes") {
// Most of QML's constructs sit at the top-level of the parse tree,
// replacing JavaScripts top-level. Here we are parsing such things
// as the root object literal and header statements of QML. Eventually,
// these rules will delegate down to JavaScript expressions.
var node = this.startNode();
node.mode = this.options.mode;
node.headerItemList = this.qml_parseHeaderItemList();
node.rootObject = null;
if (this.tok.type !== tt.eof) {
node.rootObject = this.qml_parseObjectDefinition();
}
return this.finishNode(node, "QMLProgram");
} else if (this.options.mode === "js") {
return nextMethod.call(this);
} else {
throw new Error("Unknown mode '" + this.options.mode + "'");
}
};
});
};
return acorn;
};
});

View file

@ -1,12 +0,0 @@
{
"name": "acorn-qml",
"description": "QML Parser",
"license": "EPL-1.0",
"version": "0.0.0",
"scripts": {
"test": "node test/run.js"
},
"dependencies": {
"acorn": "^2.6.4"
}
}

View file

@ -1,116 +0,0 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
"use strict";
var tests = [];
exports.test = function(code, ast, options) {
tests.push({code: code, ast: ast, options: options});
};
exports.testFail = function(code, message, options) {
tests.push({code: code, error: message, options: options});
};
exports.testAssert = function(code, assert, options) {
tests.push({code: code, assert: assert, options: options});
};
exports.runTests = function(config, callback) {
var parse = config.parse;
var opts = config.options || {};
for (var i = 0; i < tests.length; ++i) {
var test = tests[i];
if (config.filter && !config.filter(test)) continue;
try {
var testOpts = test.options || {locations: true};
for (var opt in opts) {
testOpts[opt] = opts[opt];
}
var expected = {};
if ((expected.onComment = testOpts.onComment)) {
testOpts.onComment = [];
}
if ((expected.onToken = testOpts.onToken)) {
testOpts.onToken = [];
}
testOpts.plugins = { qml: true };
testOpts.pluginsLoose = { qml: true };
var ast = parse(test.code, testOpts);
if (test.error) {
if (config.loose) {
callback("ok", test.code);
} else {
callback("fail", test.code, "Expected error message: " + test.error + "\nBut parsing succeeded.");
}
}
else if (test.assert) {
var error = test.assert(ast);
if (error) callback("fail", test.code,
"\n Assertion failed:\n " + error);
else callback("ok", test.code);
} else {
var mis = misMatch(test.ast, ast);
for (var name in expected) {
if (mis) break;
if (expected[name]) {
mis = misMatch(expected[name], testOpts[name]);
testOpts[name] = expected[name];
}
}
if (mis) callback("fail", test.code, mis);
else callback("ok", test.code);
}
} catch(e) {
if (!(e instanceof SyntaxError || e instanceof Error)) {
throw e;
}
if (test.error) {
if (e.message == test.error) callback("ok", test.code);
else callback("fail", test.code,
"Expected error message: " + test.error + "\nGot error message: " + e.message);
} else {
callback("error", test.code, e.stack || e.toString());
}
}
}
};
function ppJSON(v) { return v instanceof RegExp ? v.toString() : JSON.stringify(v, null, 2); }
function addPath(str, pt) {
if (str.charAt(str.length-1) == ")")
return str.slice(0, str.length-1) + "/" + pt + ")";
return str + " (" + pt + ")";
}
var misMatch = exports.misMatch = function(exp, act) {
var mis = null;
if (!exp || !act || (typeof exp != "object") || (typeof act != "object")) {
if (exp !== act) return ppJSON(exp) + " !== " + ppJSON(act);
} else if (exp instanceof RegExp || act instanceof RegExp) {
var left = ppJSON(exp), right = ppJSON(act);
if (left !== right) return left + " !== " + right;
} else if (exp.splice) {
if (!act.slice) return ppJSON(exp) + " != " + ppJSON(act);
if (act.length != exp.length) return "array length mismatch " + exp.length + " != " + act.length;
for (var i = 0; i < act.length; ++i) {
mis = misMatch(exp[i], act[i]);
if (mis) return addPath(mis, i);
}
} else {
for (var prop in exp) {
mis = misMatch(exp[prop], act[prop]);
if (mis) return addPath(mis, prop);
}
}
};

View file

@ -1,117 +0,0 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
"use strict";
// Get the driver and test code
var driver = require("./driver.js");
require("./tests-qml.js");
// Get and inject the QML plugin into Acorn
var acorn = require("acorn");
require("acorn/dist/acorn_loose");
require("..");
require("../loose");
function group(name) {
if (typeof console === "object" && console.group) {
console.group(name);
}
}
function groupEnd() {
if (typeof console === "object" && console.groupEnd) {
console.groupEnd(name);
}
}
function log(title, message) {
if (typeof console === "object") console.log(title, message);
}
var stats, modes = {
"Normal QML": {
config: {
parse: acorn.parse,
filter: function (test) {
var opts = test.options || {};
return opts.normal !== false && opts.qmltypes !== true;
}
}
},
"Loose QML": {
config: {
parse: acorn.parse_dammit,
filter: function (test) {
var opts = test.options || {};
return opts.loose !== false && opts.qmltypes !== true;
}
}
},
"Loose QMLTypes": {
config: {
parse: acorn.parse_dammit,
options: {
mode: "qmltypes"
},
filter: function (test) {
var opts = test.options || {};
return opts.loose !== false && opts.qmltypes !== false;
}
}
}
};
function report(state, code, message) {
if (state != "ok") {++stats.failed; log(code, message);}
++stats.testsRun;
}
group("Errors");
for (var name in modes) {
group(name);
var mode = modes[name];
stats = mode.stats = {testsRun: 0, failed: 0};
var t0 = +new Date();
driver.runTests(mode.config, report);
mode.stats.duration = +new Date() - t0;
groupEnd();
}
groupEnd();
function outputStats(name, stats) {
log(name + ":", stats.testsRun + " tests run in " + stats.duration + "ms; " +
(stats.failed ? stats.failed + " failures." : "all passed."));
}
var total = {testsRun: 0, failed: 0, duration: 0};
group("Stats");
for (var name in modes) {
var stats = modes[name].stats;
outputStats(name + " parser", stats);
for (var key in stats) total[key] += stats[key];
}
outputStats("Total", total);
groupEnd();
if (total.failed && typeof process === "object") {
process.stdout.write("", function () {
process.exit(1);
});
}

File diff suppressed because it is too large Load diff

View file

@ -1,88 +0,0 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
(function (mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
return mod(require("acorn/dist/walk"));
if (typeof define == "function" && define.amd) // AMD
return define(["acorn/dist/walk"], mod);
mod(acorn.walk); // Plain browser env
})(function (walk) {
"use strict";
function skipThrough(node, st, c) {
c(node, st);
}
function ignore(node, st, c) {}
function extendWalk(walker, funcs) {
for (var prop in funcs) {
walker[prop] = funcs[prop];
}
}
extendWalk(walk.base, {
QMLProgram: function (node, st, c) {
c(node.headerItemList, st);
if (node.rootObject) {
c(node.rootObject, st, "QMLRootObject");
}
},
QMLHeaderItemList: function (node, st, c) {
for (var i = 0; i < node.items.length; i++) {
c(node.items[i], st, "QMLHeaderItem");
}
},
QMLHeaderItem: skipThrough,
QMLImport: ignore,
QMLPragma: ignore,
QMLRootObject: skipThrough,
QMLObjectDefinition: function (node, st, c) {
c(node.body, st);
},
QMLObjectInitializer: function (node, st, c) {
for (var i = 0; i < node.members.length; i++) {
c(node.members[i], st, "QMLObjectMember");
}
},
QMLObjectMember: skipThrough,
QMLPropertyDeclaration: function (node, st, c) {
if (node.binding) {
c(node.binding, st, "QMLBinding");
}
},
QMLSignalDefinition: ignore,
QMLPropertyBinding: function (node, st, c) {
c(node.binding, st, "QMLBinding");
},
QMLBinding: skipThrough,
QMLObjectBinding: function (node, st, c) {
c(node.body, st);
},
QMLArrayBinding: function (node, st, c) {
for (var i = 0; i < node.elements.length; i++) {
c(node.elements[i], st);
}
},
QMLScriptBinding: function (node, st, c) {
c(node.script, st);
},
QMLQualifiedID: ignore,
QMLStatementBlock: function (node, st, c) {
for (var i = 0; i < node.body.length; i++) {
c(node.body[i], st, "Statement");
}
}
});
});

View file

@ -1,18 +0,0 @@
bin.includes = META-INF/,\
plugin.xml,\
templates/,\
about.html,\
plugin.properties,\
tern-qml/dist/,\
tern-qml/qml-nsh.js,\
tern-qml/qml.js,\
tern-qml/ecma5-defs.js,\
.,\
acorn-qml/index.js,\
acorn-qml/inject.js,\
acorn-qml/loose/,\
acorn-qml/walk/
src.includes = about.html,\
schema/
source.. = src/
output.. = bin/

View file

@ -1,18 +0,0 @@
# Copyright (c) 2013 QNX Software Systems and others.
#
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
pluginName=C/C++ Qt Support Core
providerName=Eclipse CDT
qtProjectFile.name = Qt Project File
qmlFile.name = QML File
qrcFile.name = Qt Resource Collection File
qmakeEnvProvider.name = QMake Environment Provider
QtInstallHeaders.pathProvider.name = Qt Installed Headers
qtNature.name=Qt Nature

View file

@ -1,175 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension-point id="qtInstallProvider" name="Qt Install Provider" schema="schema/qtInstallProvider.exsd"/>
<extension-point id="qtToolChainMapper" name="Qt ToolChain Mapper" schema="schema/qtToolChainMapper.exsd"/>
<extension
point="org.eclipse.core.contenttype.contentTypes">
<content-type
base-type="org.eclipse.core.runtime.text"
file-extensions="pro"
id="qtProjectFile"
name="%qtProjectFile.name"
priority="normal">
</content-type>
<content-type
base-type="org.eclipse.core.runtime.text"
file-extensions="qml"
id="qmlFile"
name="%qmlFile.name"
priority="normal">
</content-type>
<content-type
base-type="org.eclipse.core.runtime.xml"
file-extensions="qrc"
id="qrcFile"
name="%qrcFile.name"
priority="normal">
</content-type>
</extension>
<extension
id="qtNature"
name="%qtNature.name"
point="org.eclipse.core.resources.natures">
<runtime>
<run
class="org.eclipse.cdt.internal.qt.core.QtNature">
</run>
</runtime>
<builder
id="org.eclipse.cdt.qt.core.qtBuilder">
</builder>
</extension>
<extension
point="org.eclipse.cdt.core.PDOMASTProcessor"
id="qt.PDOMASTProcessor"
name="Qt PDOM AST Processor">
<processor
class="org.eclipse.cdt.internal.qt.core.pdom.QtPDOMASTProcessor">
<enablement>
<with variable="projectNatures">
<iterate operator="or">
<equals value="org.eclipse.cdt.qt.core.qtNature"/>
</iterate>
</with>
</enablement>
</processor>
</extension>
<extension point="org.eclipse.cdt.core.language">
<pdomLinkageFactory
id="Qt"
class="org.eclipse.cdt.internal.qt.core.pdom.PDOMQtLinkageFactory"/>
</extension>
<extension point="org.eclipse.core.expressions.definitions">
<definition id="org.eclipse.cdt.qt.core.isQtProject">
<with variable="projectNatures">
<iterate operator="or">
<equals value="org.eclipse.cdt.qt.core.qtNature"/>
</iterate>
</with>
</definition>
</extension>
<extension
point="org.eclipse.cdt.codan.core.checkers"
id="org.eclipse.cdt.core.qt.SyntaxCheckers">
<category
id="org.eclipse.cdt.qt.core.qtproblemcategory"
name="Qt Problems">
</category>
<checker
id="org.eclipse.cdt.core.qt.connectfunctioncallchecker"
name="Qt Connect Function Call Checker"
class="org.eclipse.cdt.internal.qt.core.codan.QtSyntaxChecker">
<problem
category="org.eclipse.cdt.qt.core.qtproblemcategory"
defaultEnabled="true"
defaultSeverity="Warning"
id="org.eclipse.cdt.qt.core.qtproblem"
markerType="org.eclipse.cdt.qt.core.qtproblem"
messagePattern="{0}"
name="Qt Syntax Problem">
</problem>
</checker>
</extension>
<extension
point="org.eclipse.core.resources.markers"
id="qtproblem"
name="Qt C/C++ Problem">
<super type="org.eclipse.cdt.codan.core.codanProblem"/>
<persistent value="true"/>
</extension>
<extension
point="org.eclipse.cdt.core.buildConfigProvider">
<provider
class="org.eclipse.cdt.internal.qt.core.build.QtBuildConfigurationProvider"
id="org.eclipse.cdt.qt.core.qtBuildConfigProvider"
natureId="org.eclipse.cdt.qt.core.qtNature">
</provider>
</extension>
<extension
point="org.eclipse.cdt.core.toolChainProvider">
<provider
class="org.eclipse.cdt.qt.core.QtMinGWToolChainProvider"
id="org.eclipse.cdt.qt.core.qtMinGWProvider">
</provider>
</extension>
<extension
point="org.eclipse.cdt.qt.core.qtInstallProvider">
<provider
class="org.eclipse.cdt.internal.qt.core.provider.Msys2QtInstallProvider">
</provider>
<provider
class="org.eclipse.cdt.internal.qt.core.provider.HomebrewQtInstallProvider">
</provider>
<provider
class="org.eclipse.cdt.internal.qt.core.provider.QtInstallProvider">
</provider>
<provider
class="org.eclipse.cdt.internal.qt.core.provider.LinuxQtInstallProvider">
</provider>
</extension>
<extension
point="org.eclipse.cdt.qt.core.qtToolChainMapper">
<mapping
spec="macx-clang">
<property
key="os"
value="macosx">
</property>
<property
key="arch"
value="x86_64">
</property>
</mapping>
<mapping
spec="win32-g++">
<property
key="os"
value="win32">
</property>
<property
key="arch"
value="x86_64">
</property>
</mapping>
<mapping
spec="linux-g++-64">
<property
key="os"
value="linux">
</property>
<property
key="arch"
value="x86_64">
</property>
</mapping>
<mapping
spec="linux-g++">
<property
key="os"
value="linux">
</property>
</mapping>
</extension>
</plugin>

View file

@ -1,102 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.eclipse.cdt.qt.core" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appinfo>
<meta.schema plugin="org.eclipse.cdt.qt.core" id="qtInstallProvider" name="Qt Install Provider"/>
</appinfo>
<documentation>
[Enter description of this extension point.]
</documentation>
</annotation>
<element name="extension">
<annotation>
<appinfo>
<meta.element />
</appinfo>
</annotation>
<complexType>
<sequence>
<element ref="provider" minOccurs="1" maxOccurs="unbounded"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string">
<annotation>
<documentation>
</documentation>
<appinfo>
<meta.attribute translatable="true"/>
</appinfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="provider">
<complexType>
<attribute name="class" type="string" use="required">
<annotation>
<documentation>
</documentation>
<appinfo>
<meta.attribute kind="java" basedOn=":org.eclipse.cdt.qt.core.IQtInstallProvider"/>
</appinfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appinfo>
<meta.section type="since"/>
</appinfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="examples"/>
</appinfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="apiinfo"/>
</appinfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="implementation"/>
</appinfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
</schema>

View file

@ -1,121 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.eclipse.cdt.qt.core" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appinfo>
<meta.schema plugin="org.eclipse.cdt.qt.core" id="qtToolChainMapper" name="Qt ToolChain Mapper"/>
</appinfo>
<documentation>
[Enter description of this extension point.]
</documentation>
</annotation>
<element name="extension">
<annotation>
<appinfo>
<meta.element />
</appinfo>
</annotation>
<complexType>
<sequence minOccurs="1" maxOccurs="unbounded">
<element ref="mapping"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string">
<annotation>
<documentation>
</documentation>
<appinfo>
<meta.attribute translatable="true"/>
</appinfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="mapping">
<complexType>
<sequence minOccurs="0" maxOccurs="unbounded">
<element ref="property"/>
</sequence>
<attribute name="spec" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<element name="property">
<complexType>
<attribute name="key" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="value" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appinfo>
<meta.section type="since"/>
</appinfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="examples"/>
</appinfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="apiinfo"/>
</appinfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="implementation"/>
</appinfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
</schema>

View file

@ -1,281 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.regex.Pattern;
import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTExpression;
import org.eclipse.cdt.core.dom.ast.IASTFunctionCallExpression;
import org.eclipse.cdt.core.dom.ast.IASTIdExpression;
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IScope;
import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFieldReference;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTInitializerClause;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisibilityLabel;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
import org.eclipse.cdt.internal.qt.core.index.IQMethod;
import org.eclipse.cdt.internal.qt.core.index.IQObject;
import org.eclipse.core.resources.IProject;
@SuppressWarnings("restriction")
public class ASTUtil {
/**
* A convenience method to find the project that contains the given node. Returns null if
* the project cannot be found.
*/
public static IProject getProject(IASTNode node) {
IASTTranslationUnit astTU = node.getTranslationUnit();
if (astTU == null)
return null;
ITranslationUnit tu = astTU.getOriginatingTranslationUnit();
if (tu == null)
return null;
ICProject cProject = tu.getCProject();
if (cProject == null)
return null;
return cProject.getProject();
}
/**
* Return the fully qualified name of the binding for the given name. Returns null
* if the name has no binding. Tries to resolve the binding if needed.
*/
public static String getFullyQualifiedName(IASTName name) {
return getFullyQualifiedName(name.resolveBinding());
}
/**
* Return the fully qualified name of the given binding. Returns null if there
* is no binding.
*/
public static String getFullyQualifiedName(IBinding binding) {
if (binding == null)
return null;
if (binding instanceof ICPPBinding)
try {
return getFullyQualifiedName(((ICPPBinding) binding).getQualifiedName());
} catch (DOMException e) {
Activator.log(e);
return null;
}
String ownerName = getFullyQualifiedName(binding.getOwner());
return (ownerName == null ? "" : ownerName) + "::" + binding.getName(); //$NON-NLS-1$ //$NON-NLS-2$
}
/**
* Create and return a string representation of the fully qualified name in the
* input array's elements.
*/
public static String getFullyQualifiedName(String[] qualName) {
boolean first = true;
StringBuilder str = new StringBuilder();
for (String name : qualName) {
if (first)
first = false;
else
str.append("::"); //$NON-NLS-1$
str.append(name);
}
return str.toString();
}
// NOTE: This expression allows embedded line terminators (?s) for cases where the code looks like:
// QObject::connect( &a, SIGNAL(
// sig1(
// int
// ), ...
// The regex trims leading and trailing whitespace within the expansion parameter. This is needed
// so that the start of the capture group provides the proper offset into the expansion.
public static final Pattern Regex_MacroExpansion = Pattern
.compile("(?s)([_a-zA-Z]\\w*)\\s*\\(\\s*(.*?)\\s*\\)\\s*"); //$NON-NLS-1$
public static IType getBaseType(IType type) {
while (type instanceof ITypeContainer)
type = ((ITypeContainer) type).getType();
return type;
}
public static IType getBaseType(IASTNode node) {
if (node instanceof IASTIdExpression)
return getBaseType((IASTIdExpression) node);
if (node instanceof IASTFunctionCallExpression)
return getBaseType((IASTFunctionCallExpression) node);
if (node instanceof IASTExpression)
return getBaseType(((IASTExpression) node).getExpressionType());
return null;
}
public static IType getBaseType(IASTInitializerClause init) {
if (!(init instanceof ICPPASTInitializerClause))
return null;
ICPPASTInitializerClause cppInit = (ICPPASTInitializerClause) init;
ICPPEvaluation eval = cppInit.getEvaluation();
try {
CPPSemantics.pushLookupPoint(cppInit);
return eval == null ? null : getBaseType(eval.getType());
} finally {
CPPSemantics.popLookupPoint();
}
}
public static ICPPClassType getReceiverType(IASTFunctionCallExpression fncall) {
// If the expression is calling a member function then find the type of the
// receiver.
IASTExpression fnName = fncall.getFunctionNameExpression();
if (fnName instanceof ICPPASTFieldReference) {
ICPPASTFieldReference fieldRef = (ICPPASTFieldReference) fnName;
ICPPASTExpression receiver = fieldRef.getFieldOwner();
IType recvType = getBaseType(receiver);
if (recvType instanceof ICPPClassType)
return (ICPPClassType) recvType;
}
// Otherwise check for a call to implicit 'this'. See details in the thread that
// starts at http://dev.eclipse.org/mhonarc/lists/cdt-dev/msg26972.html
try {
for (IScope scope = CPPVisitor.getContainingScope(fncall); scope != null; scope = scope.getParent())
if (scope instanceof ICPPClassScope)
return ((ICPPClassScope) scope).getClassType();
} catch (DOMException e) {
Activator.log(e);
}
return null;
}
/**
* Does not return null.
*/
public static Collection<IQMethod> findMethods(IQObject qobj, QtMethodReference ref) {
Set<IQMethod> bindings = new LinkedHashSet<>();
Iterable<IQMethod> methods = null;
switch (ref.getType()) {
case Signal:
methods = qobj.getSignals().withoutOverrides();
break;
case Slot:
methods = qobj.getSlots().withoutOverrides();
break;
}
if (methods != null) {
String qtNormalizedSig = QtMethodUtil.getQtNormalizedMethodSignature(ref.getRawSignature());
if (qtNormalizedSig == null)
return bindings;
for (IQMethod method : methods)
for (String signature : method.getSignatures())
if (signature.equals(qtNormalizedSig))
bindings.add(method);
}
return bindings;
}
public static <T extends IBinding> T resolveFunctionBinding(Class<T> cls, IASTFunctionCallExpression fnCall) {
IASTName fnName = null;
IASTExpression fnNameExpr = fnCall.getFunctionNameExpression();
if (fnNameExpr instanceof IASTIdExpression)
fnName = ((IASTIdExpression) fnNameExpr).getName();
else if (fnNameExpr instanceof ICPPASTFieldReference)
fnName = ((ICPPASTFieldReference) fnNameExpr).getFieldName();
IBinding binding = fnName == null ? null : fnName.resolveBinding();
if (binding == null)
return null;
return cls.isAssignableFrom(binding.getClass()) ? cls.cast(binding) : null;
}
public static ICPPASTVisibilityLabel findVisibilityLabel(ICPPMethod method, IASTNode ast) {
// the visibility cannot be found without an ast
if (ast == null)
return null;
// We need to get the CompTypeSpec in order to see the token that created the method's
// visibility specifier. The ast parameter will be either the method definition or a
// declaration. If it happens to be a declaration, then the CompTypeSpec is a parent of
// the AST and it can be accessed through public API. However, if the ast parameter happens
// to be a definition, then there isn't any public API (that I've found) to get to the
// CompTypeSpec. Instead, we cheat and use the InternalBinding.
MethodSpec methodSpec = new MethodSpec(ast);
if (methodSpec.clsSpec == null && method instanceof ICPPInternalBinding) {
ICPPInternalBinding internalBinding = (ICPPInternalBinding) method;
IASTNode[] decls = internalBinding.getDeclarations();
for (int i = 0; methodSpec.clsSpec == null && i < decls.length; ++i)
methodSpec = new MethodSpec(decls[i]);
}
if (methodSpec.clsSpec == null)
return null;
ICPPASTVisibilityLabel lastLabel = null;
for (IASTDeclaration decl : methodSpec.clsSpec.getMembers()) {
if (decl instanceof ICPPASTVisibilityLabel)
lastLabel = (ICPPASTVisibilityLabel) decl;
else if (decl == methodSpec.methodDecl)
return lastLabel;
}
return null;
}
private static class MethodSpec {
public final ICPPASTCompositeTypeSpecifier clsSpec;
public final IASTNode methodDecl;
public MethodSpec(IASTNode node) {
ICPPASTCompositeTypeSpecifier cls = null;
IASTNode mth = node;
while (mth != null && cls == null) {
IASTNode parent = mth.getParent();
if (parent instanceof ICPPASTCompositeTypeSpecifier)
cls = (ICPPASTCompositeTypeSpecifier) parent;
else
mth = parent;
}
clsSpec = cls;
methodDecl = mth;
}
}
}

View file

@ -1,137 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core;
import java.io.IOException;
import javax.script.ScriptException;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.qt.core.IQMLAnalyzer;
import org.eclipse.cdt.qt.core.IQtInstallManager;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
public class Activator extends Plugin {
public static final String ID = "org.eclipse.cdt.qt.core"; //$NON-NLS-1$
public static final String SIGNAL_SLOT_TAGGER_ID = ID + ".signalslot.tagger"; //$NON-NLS-1$
public static final int SignalSlot_Mask_signal = 1;
public static final int SignalSlot_Mask_slot = 2;
public static final String QMAKE_ENV_PROVIDER_EXT_POINT_NAME = "qmakeEnvProvider"; //$NON-NLS-1$
public static final String QMAKE_ENV_PROVIDER_ID = ID + "." + QMAKE_ENV_PROVIDER_EXT_POINT_NAME; //$NON-NLS-1$
public static final String QT_SYNTAX_ERR_ID = "org.eclipse.cdt.qt.core.qtproblem"; //$NON-NLS-1$
/**
* Instances of QtIndex are cached within the session properties of the
* project from which they are created. This name is used to store the
* property.
*/
public static final QualifiedName QTINDEX_PROP_NAME = new QualifiedName(ID, "qtindex"); //$NON-NLS-1$
private static Activator instance;
public static Activator getDefault() {
return instance;
}
public Activator() {
instance = this;
}
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
context.registerService(IQtInstallManager.class, new QtInstallManager(), null);
QMLAnalyzer qmlAnalyzer = new QMLAnalyzer();
context.registerService(IQMLAnalyzer.class, qmlAnalyzer, null);
Job startupJob = new Job("Load QML Analyzer") { //$NON-NLS-1$
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
qmlAnalyzer.load();
} catch (NoSuchMethodException | ScriptException | IOException e) {
log(e);
}
return Status.OK_STATUS;
}
};
startupJob.setSystem(true);
startupJob.schedule();
}
@Override
public void stop(BundleContext context) throws Exception {
// QMakeProjectInfoManager.stop();
super.stop(context);
}
public static CoreException coreException(String msg) {
return new CoreException(new Status(IStatus.INFO, ID, msg));
}
public static IStatus info(String msg) {
return new Status(IStatus.INFO, ID, msg);
}
public static IStatus error(String msg) {
return error(msg, null);
}
public static IStatus error(String msg, Throwable e) {
return new Status(IStatus.ERROR, ID, msg, e);
}
public static void log(String e) {
log(IStatus.INFO, e, null);
}
public static void log(Throwable e) {
String msg = e.getMessage();
if (msg == null) {
log("Error", e); //$NON-NLS-1$
} else {
log("Error: " + msg, e); //$NON-NLS-1$
}
}
public static void log(String message, Throwable e) {
Throwable nestedException;
if (e instanceof CModelException && (nestedException = ((CModelException) e).getException()) != null) {
e = nestedException;
}
log(IStatus.ERROR, message, e);
}
public static void log(int code, String msg, Throwable e) {
getDefault().getLog().log(new Status(code, ID, msg, e));
}
public static <T> T getService(Class<T> service) {
BundleContext context = instance.getBundle().getBundleContext();
ServiceReference<T> ref = context.getServiceReference(service);
return ref != null ? context.getService(ref) : null;
}
}

View file

@ -1,18 +0,0 @@
package org.eclipse.cdt.internal.qt.core;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.qt.core.messages"; //$NON-NLS-1$
public static String QtBuildConfiguration_ConfigNotFound;
public static String QtBuildConfiguration_MakeNotFound;
public static String QtBuilder_0;
public static String QtBuildTab_Name;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
private Messages() {
}
}

View file

@ -1,365 +0,0 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.cdt.internal.qt.core;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.script.Bindings;
import javax.script.Invocable;
import javax.script.ScriptContext;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import org.eclipse.cdt.qt.core.IQMLAnalyzer;
import org.eclipse.cdt.qt.core.QMLTernCompletion;
import org.eclipse.cdt.qt.core.qmljs.IQmlASTNode;
@SuppressWarnings("nls")
public class QMLAnalyzer implements IQMLAnalyzer {
private QMLModuleResolver moduleResolver;
private ScriptEngine engine;
private Boolean supported;
private Invocable invoke;
private Object tern;
@Override
public void load() throws ScriptException, IOException, NoSuchMethodException {
moduleResolver = new QMLModuleResolver(this);
engine = new ScriptEngineManager().getEngineByName("nashorn");
if (engine == null) {
synchronized (this) {
supported = false;
notifyAll();
}
throw new ScriptException(
"Nashorn script engine is not available in Java 15 and above. The QML Analyzer is not supported.");
}
invoke = (Invocable) engine;
loadDep("/tern-qml/node_modules/acorn/dist/acorn.js");
loadDep("/tern-qml/node_modules/acorn/dist/acorn_loose.js");
loadDep("/tern-qml/node_modules/acorn/dist/walk.js");
loadDep("/tern-qml/node_modules/tern/lib/signal.js");
loadDep("/tern-qml/node_modules/tern/lib/tern.js");
loadDep("/tern-qml/node_modules/tern/lib/def.js");
loadDep("/tern-qml/node_modules/tern/lib/comment.js");
loadDep("/tern-qml/node_modules/tern/lib/infer.js");
load("/acorn-qml/inject.js");
load("/acorn-qml/index.js");
load("/acorn-qml/loose/inject.js");
load("/acorn-qml/loose/index.js");
load("/acorn-qml/walk/index.js");
load("/tern-qml/qml.js");
load("/tern-qml/qml-nsh.js");
Bindings options = (Bindings) engine.eval("new Object()");
options.put("ecmaVersion", 5);
Bindings plugins = (Bindings) engine.eval("new Object()");
plugins.put("qml", true);
options.put("plugins", plugins);
Bindings defs = (Bindings) engine.eval("new Array()");
load("/tern-qml/ecma5-defs.js");
invoke.invokeMethod(defs, "push", engine.get("ecma5defs"));
options.put("defs", defs);
ResolveDirectory resolveDirectory = (file, pathString) -> {
String filename = (String) file.get("name");
String fileDirectory = new File(filename).getParent();
if (fileDirectory == null) {
fileDirectory = "";
}
if (pathString == null) {
return fixPathString(fileDirectory);
}
Path fileDirectoryPath = Paths.get(fileDirectory);
Path path = Paths.get(pathString);
if (!path.isAbsolute()) {
path = fileDirectoryPath.toAbsolutePath().resolve(path);
}
return fixPathString(path.normalize().toString());
};
options.put("resolveDirectory", invoke.invokeFunction("resolveDirectory", resolveDirectory));
options.put("resolveModule", invoke.invokeFunction("resolveModule", moduleResolver));
synchronized (this) {
tern = invoke.invokeFunction("newTernServer", options);
supported = tern != null;
notifyAll();
}
}
@FunctionalInterface
public interface ResolveDirectory {
public String resolveDirectory(Bindings file, String path);
}
private Object load(String file) throws ScriptException, IOException {
URL scriptURL = Activator.getDefault().getBundle().getEntry(file);
if (scriptURL == null) {
throw new FileNotFoundException(file);
}
engine.getContext().setAttribute(ScriptEngine.FILENAME, file, ScriptContext.ENGINE_SCOPE);
return engine.eval(new BufferedReader(new InputStreamReader(scriptURL.openStream(), StandardCharsets.UTF_8)));
}
private Object loadDep(String file) throws ScriptException, IOException {
try {
return load(file);
} catch (FileNotFoundException e) {
return load(file.replace("/tern-qml/node_modules/", "/tern-qml/dist/"));
}
}
@Override
public boolean isSupported() {
synchronized (this) {
while (supported == null) {
try {
wait();
} catch (InterruptedException e) {
Activator.log(e);
return false;
}
}
return supported;
}
}
private void waitUntilLoaded() throws ScriptException {
if (!isSupported()) {
throw new ScriptException(
"Nashorn script engine is not available in Java 15 and above. The QML Analyzer is not supported.");
}
}
@FunctionalInterface
public interface RequestCallback {
void callback(Object err, Object data);
}
private String fixPathString(String fileName) {
fileName = fileName.replaceAll("\\\\", "/");
if (fileName.startsWith("/")) {
fileName = fileName.substring(1);
}
return fileName;
}
@Override
public void addFile(String fileName, String code) throws NoSuchMethodException, ScriptException {
waitUntilLoaded();
invoke.invokeMethod(tern, "addFile", fixPathString(fileName), code);
}
@Override
public void deleteFile(String fileName) throws NoSuchMethodException, ScriptException {
waitUntilLoaded();
invoke.invokeMethod(tern, "delFile", fixPathString(fileName));
}
private static class ASTCallback implements RequestCallback {
private IQmlASTNode ast;
@Override
public void callback(Object err, Object data) {
if (err != null) {
throw new RuntimeException(err.toString());
} else {
try {
ast = QmlASTNodeHandler.createQmlASTProxy((Bindings) ((Bindings) data).get("ast"));
} catch (Throwable e) {
throw new RuntimeException(e);
}
}
}
public IQmlASTNode getAST() {
return ast;
}
}
@Override
public IQmlASTNode parseFile(String fileName, String text) throws NoSuchMethodException, ScriptException {
waitUntilLoaded();
fileName = fixPathString(fileName);
Bindings query = engine.createBindings();
query.put("type", "parseFile");
query.put("file", fileName);
Bindings request = engine.createBindings();
request.put("query", query);
if (text != null) {
Bindings file = engine.createBindings();
file.put("type", "full");
file.put("name", fileName);
file.put("text", text);
Bindings files = (Bindings) engine.eval("new Array()");
invoke.invokeMethod(files, "push", file);
request.put("files", files);
}
ASTCallback callback = new ASTCallback();
invoke.invokeMethod(tern, "request", request, invoke.invokeFunction("requestCallback", callback));
return callback.getAST();
}
@Override
public IQmlASTNode parseString(String text) throws NoSuchMethodException, ScriptException {
return parseString(text, "qml", false, false);
}
@Override
public IQmlASTNode parseString(String text, String mode, boolean locations, boolean ranges)
throws NoSuchMethodException, ScriptException {
waitUntilLoaded();
Bindings options = engine.createBindings();
options.put("mode", mode);
options.put("locations", locations);
options.put("ranges", ranges);
ASTCallback callback = new ASTCallback();
invoke.invokeMethod(tern, "parseString", text, options, invoke.invokeFunction("requestCallback", callback));
return callback.getAST();
}
protected <T> T[] toJavaArray(Bindings binding, Class<T[]> clazz) throws NoSuchMethodException, ScriptException {
return clazz.cast(invoke.invokeMethod(engine.get("Java"), "to", binding,
clazz.getCanonicalName() + (clazz.isArray() ? "" : "[]")));
}
@Override
public Collection<QMLTernCompletion> getCompletions(String fileName, String text, int pos)
throws NoSuchMethodException, ScriptException {
return getCompletions(fileName, text, pos, true);
}
@Override
public Collection<QMLTernCompletion> getCompletions(String fileName, String text, int pos, boolean includeKeywords)
throws NoSuchMethodException, ScriptException {
waitUntilLoaded();
fileName = fixPathString(fileName);
Bindings query = engine.createBindings();
query.put("type", "completions");
query.put("lineCharPositions", true);
query.put("file", fileName);
query.put("end", pos);
query.put("types", true);
query.put("docs", false);
query.put("urls", false);
query.put("origins", true);
query.put("filter", true);
query.put("caseInsensitive", true);
query.put("guess", false);
query.put("sort", true);
query.put("expandWordForward", false);
query.put("includeKeywords", includeKeywords);
Bindings request = engine.createBindings();
request.put("query", query);
if (text != null) {
Bindings file = engine.createBindings();
file.put("type", "full");
file.put("name", fileName);
file.put("text", text);
Bindings files = (Bindings) engine.eval("new Array()");
invoke.invokeMethod(files, "push", file);
request.put("files", files);
}
List<QMLTernCompletion> completions = new ArrayList<>();
RequestCallback callback = (err, data) -> {
if (err != null) {
throw new RuntimeException(err.toString());
} else {
try {
Bindings comps = (Bindings) ((Bindings) data).get("completions");
for (Bindings completion : toJavaArray(comps, Bindings[].class)) {
completions.add(new QMLTernCompletion((String) completion.get("name"),
(String) completion.get("type"), (String) completion.get("origin")));
}
} catch (Throwable e) {
throw new RuntimeException(e);
}
}
};
invoke.invokeMethod(tern, "request", request, invoke.invokeFunction("requestCallback", callback));
return completions;
}
@Override
public List<Bindings> getDefinition(String identifier, String fileName, String text, int pos)
throws NoSuchMethodException, ScriptException {
waitUntilLoaded();
fileName = fixPathString(fileName);
Bindings query = engine.createBindings();
query.put("type", "definition");
query.put("file", fileName);
query.put("end", pos);
query.put("types", true);
query.put("docs", false);
query.put("urls", false);
query.put("origins", true);
query.put("caseInsensitive", true);
query.put("lineCharPositions", true);
query.put("expandWordForward", false);
query.put("includeKeywords", true);
query.put("guess", false);
Bindings request = engine.createBindings();
request.put("query", query);
if (text != null) {
Bindings file = engine.createBindings();
file.put("type", "full");
file.put("name", fileName);
file.put("text", text);
Bindings files = (Bindings) engine.eval("new Array()");
invoke.invokeMethod(files, "push", file);
request.put("files", files);
}
List<Bindings> definitions = new ArrayList<>();
RequestCallback callback = (err, data) -> {
if (err != null) {
throw new RuntimeException(err.toString());
} else {
definitions.add((Bindings) data);
}
};
invoke.invokeMethod(tern, "request", request, invoke.invokeFunction("requestCallback", callback));
return definitions;
}
}

View file

@ -1,102 +0,0 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.qt.core;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Path;
import javax.script.ScriptException;
import org.eclipse.cdt.internal.qt.core.qmltypes.QMLModelBuilder;
import org.eclipse.cdt.internal.qt.core.qmltypes.QMLModuleInfo;
import org.eclipse.cdt.qt.core.IQtInstall;
import org.eclipse.cdt.qt.core.IQtInstallManager;
import org.eclipse.cdt.qt.core.qmldir.QMLDirectoryInfo;
import org.eclipse.cdt.qt.core.qmljs.IQmlASTNode;
public class QMLModuleResolver {
private final QMLAnalyzer analyzer;
private final IQtInstallManager manager;
private final QMLModelBuilder builder;
public QMLModuleResolver(QMLAnalyzer analyzer) {
this.analyzer = analyzer;
this.manager = Activator.getService(IQtInstallManager.class);
this.builder = new QMLModelBuilder();
}
// TODO: determine exactly how to give this to Tern. For now we'll just return the reference to the QMLModuleInfo
// that we found
public QMLModuleInfo resolveModule(String module) throws NoSuchMethodException, ScriptException {
QMLModuleInfo info = builder.getModule(module);
if (info == null) {
Path path = getModulePath(module);
if (path != null) {
File qmldir = path.resolve("qmldir").normalize().toFile(); //$NON-NLS-1$
try {
String types = getQmlTypesFile(qmldir);
File qmlTypes = path.resolve(types).toFile();
String typeContents = fileToString(qmlTypes);
IQmlASTNode ast = analyzer.parseString(typeContents, "qmltypes", false, false); //$NON-NLS-1$
info = builder.addModule(module, ast);
} catch (IOException e) {
Activator.log(e);
}
}
}
return info;
}
private String fileToString(File file) throws IOException {
try (InputStream stream = new FileInputStream(file)) {
StringBuilder sb = new StringBuilder();
int read = -1;
while ((read = stream.read()) != -1) {
sb.append((char) read);
}
return sb.toString();
}
}
private String getQmlTypesFile(File qmldir) throws IOException {
try (InputStream stream = new FileInputStream(qmldir)) {
QMLDirectoryInfo info = new QMLDirectoryInfo(stream);
return info.getTypesFileName();
}
}
private Path getModulePath(String module) {
if (module != null) {
for (IQtInstall install : manager.getInstalls()) {
Path qmlPath = install.getQmlPath();
Path modPath = null;
if (module.equals("QtQuick")) { //$NON-NLS-1$
modPath = qmlPath.resolve("QtQuick.2").normalize(); //$NON-NLS-1$
} else {
modPath = qmlPath;
for (String part : module.split("\\.")) { //$NON-NLS-1$
modPath = modPath.resolve(part).normalize();
}
}
if (modPath.toFile().exists()) {
return modPath;
}
}
}
return null;
}
}

View file

@ -1,252 +0,0 @@
/*******************************************************************************
* Copyright (c) 2015, 2016 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.qt.core;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.script.Bindings;
import org.eclipse.cdt.internal.qt.core.location.Position;
import org.eclipse.cdt.internal.qt.core.location.SourceLocation;
import org.eclipse.cdt.qt.core.IQMLAnalyzer;
import org.eclipse.cdt.qt.core.location.ISourceLocation;
import org.eclipse.cdt.qt.core.qmljs.IJSLiteral;
import org.eclipse.cdt.qt.core.qmljs.IJSRegExpLiteral;
import org.eclipse.cdt.qt.core.qmljs.IQmlASTNode;
import org.eclipse.cdt.qt.core.qmljs.IQmlObjectDefinition;
import org.eclipse.cdt.qt.core.qmljs.IQmlRootObject;
/**
* Translates a JavaScript {@link Bindings} object into a QML AST. This class employs {@link java.lang.reflect.Proxy} in order to
* dynamically create the AST at runtime.
* <p>
* To begin translation simply call the static method <code>createQmlASTProxy</code>. The AST is translated only when it needs to be
* (i.e. when one of its 'get' methods are called).
*/
public class QmlASTNodeHandler implements InvocationHandler {
private static final String NODE_QML_PREFIX = "QML"; //$NON-NLS-1$
private static final String NODE_TYPE_PROPERTY = "type"; //$NON-NLS-1$
private static final String NODE_REGEX_PROPERTY = "regex"; //$NON-NLS-1$
private static final String CREATE_ENUM_METHOD = "fromObject"; //$NON-NLS-1$
private static final String AST_PACKAGE = "org.eclipse.cdt.qt.core.qmljs."; //$NON-NLS-1$
private static final String AST_QML_PREFIX = "IQml"; //$NON-NLS-1$
private static final String AST_JS_PREFIX = "IJS"; //$NON-NLS-1$
private static String getPropertyName(String method) {
String name = ""; //$NON-NLS-1$
if (method.startsWith("is")) { //$NON-NLS-1$
name = method.substring(2, 3).toLowerCase() + method.substring(3);
} else if (method.startsWith("get")) { //$NON-NLS-1$
name = method.substring(3, 4).toLowerCase() + method.substring(4);
}
if (name.equalsIgnoreCase("identifier")) { //$NON-NLS-1$
return "id"; //$NON-NLS-1$
} else if (name.equalsIgnoreCase("location")) { //$NON-NLS-1$
return "loc"; //$NON-NLS-1$
}
return name;
}
/**
* Constructs a new {@link IQmlASTNode} from the given {@link Bindings}. This is a helper method equivalent to
* <code>createQmlASTProxy(node, null)</code>
*
* @param node
* the AST node as retrieved from Nashorn
* @return a Proxy representing the given node
* @throws ClassNotFoundException
* if the node does not represent a valid QML AST Node
* @see {@link QmlASTNodeHandler#createQmlASTProxy(Bindings, Class)}
*/
public static IQmlASTNode createQmlASTProxy(Bindings node) throws ClassNotFoundException {
return createQmlASTProxy(node, null);
}
/**
* Constructs a new {@link IQmlASTNode} from the given {@link Bindings}. If a return type is specified, it will take precedence
* over the type retrieved from the binding. This is useful for nodes that extend, but do not add functionality to, an acorn AST
* element. A good example of this is {@link IQmlRootObject} which extends {@link IQmlObjectDefinition}. We can easily determine
* the location in the AST at which we want an IQmlRootObject over an IQmlObjectDefinition and set the returnType accordingly.
*
* @param node
* the node as retrieved from acorn
* @param returnType
* the expected node to return or null
* @return a Proxy representing the given node
* @throws ClassNotFoundException
* if the node does not represent a valid QML AST Node
*/
public static IQmlASTNode createQmlASTProxy(Bindings node, Class<?> returnType) throws ClassNotFoundException {
String type = (String) node.getOrDefault(NODE_TYPE_PROPERTY, ""); //$NON-NLS-1$
if (type.startsWith(NODE_QML_PREFIX)) {
type = AST_QML_PREFIX + type.substring(3);
} else {
type = AST_JS_PREFIX + type;
}
Class<?> astClass = Class.forName(AST_PACKAGE + type);
if (astClass.equals(IJSLiteral.class)) {
// If this is a Literal, we have to distinguish it between a RegExp Literal using the 'regex' property
if (node.get(NODE_REGEX_PROPERTY) != null) {
astClass = IJSRegExpLiteral.class;
}
}
if (returnType != null) {
if (!IQmlASTNode.class.isAssignableFrom(astClass)) {
throw new ClassCastException(astClass + " cannot be cast to " + IQmlASTNode.class); //$NON-NLS-1$
}
if (astClass.isAssignableFrom(returnType)) {
astClass = returnType;
}
}
return (IQmlASTNode) Proxy.newProxyInstance(QmlASTNodeHandler.class.getClassLoader(),
new Class<?>[] { astClass }, new QmlASTNodeHandler(node));
}
private final QMLAnalyzer analyzer;
private final Bindings node;
private final Map<String, Object> methodResults;
private QmlASTNodeHandler(Bindings node) {
this.analyzer = (QMLAnalyzer) Activator.getService(IQMLAnalyzer.class);
this.node = node;
this.methodResults = new HashMap<>();
}
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
String mName = method.getName();
if (!methodResults.containsKey(method.getName())) {
// Invoke the default implementation of the method if possible
if (method.isDefault()) {
final Class<?> declaringClass = method.getDeclaringClass();
Constructor<MethodHandles.Lookup> constructor = MethodHandles.Lookup.class
.getDeclaredConstructor(Class.class, int.class);
constructor.setAccessible(true);
methodResults.put(mName, constructor.newInstance(declaringClass, MethodHandles.Lookup.PRIVATE)
.unreflectSpecial(method, declaringClass).bindTo(proxy).invokeWithArguments(args));
} else {
// Use the return type of the method as well as its contents of the node to get the Object to return
String pName = getPropertyName(mName);
methodResults.put(mName, handleObject(node.get(pName), method.getReturnType()));
}
}
return methodResults.get(mName);
}
private Object handleObject(Object value, Class<?> expectedType) throws Throwable {
if (expectedType.isArray()) {
Object arr = Array.newInstance(expectedType.getComponentType(), ((Bindings) value).size());
int ctr = 0;
for (Object obj : ((Bindings) value).values()) {
Array.set(arr, ctr++, handleObject(obj, expectedType.getComponentType()));
}
return arr;
} else if (expectedType.equals(Object.class)) {
return value;
} else if (expectedType.isAssignableFrom(ISourceLocation.class)) {
// ISourceLocation doesn't correspond to an AST Node and needs to be created manually from
// the given Bindings.
if (value instanceof Bindings) {
Bindings bind = (Bindings) value;
SourceLocation loc = new SourceLocation();
loc.setSource((String) bind.get("source")); //$NON-NLS-1$
Bindings start = (Bindings) bind.get("start"); //$NON-NLS-1$
loc.setStart(new Position(((Number) start.get("line")).intValue(), //$NON-NLS-1$
((Number) start.get("column")).intValue())); //$NON-NLS-1$
Bindings end = (Bindings) bind.get("end"); //$NON-NLS-1$
loc.setEnd(new Position(((Number) end.get("line")).intValue(), //$NON-NLS-1$
((Number) end.get("column")).intValue())); //$NON-NLS-1$
return loc;
}
return new SourceLocation();
} else if (expectedType.isAssignableFrom(List.class)) {
if (value instanceof Bindings) {
List<Object> list = new ArrayList<>();
for (Bindings object : analyzer.toJavaArray((Bindings) value, Bindings[].class)) {
list.add(QmlASTNodeHandler.createQmlASTProxy(object));
}
return list;
}
return null;
} else if (expectedType.isPrimitive()) {
return handlePrimitive(value, expectedType);
} else if (expectedType.isAssignableFrom(Number.class)) {
if (value instanceof Number) {
return value;
}
return 0;
} else if (expectedType.isEnum()) {
return expectedType.getMethod(CREATE_ENUM_METHOD, Object.class).invoke(null, value);
} else if (value instanceof Bindings) {
return QmlASTNodeHandler.createQmlASTProxy((Bindings) value, expectedType);
}
return value;
}
private Object handlePrimitive(Object value, Class<?> expectedType) throws Throwable {
if (expectedType.isPrimitive()) {
if (expectedType.equals(Boolean.TYPE)) {
if (value instanceof Boolean) {
return value;
}
return false;
} else if (expectedType.equals(Character.TYPE)) {
if (value instanceof Character) {
return value;
}
return '\0';
} else if (expectedType.equals(Byte.TYPE)) {
if (value instanceof Number) {
return ((Number) value).byteValue();
}
return (byte) 0;
} else if (expectedType.equals(Short.TYPE)) {
if (value instanceof Number) {
return ((Number) value).shortValue();
}
return (short) 0;
} else if (expectedType.equals(Integer.TYPE)) {
if (value instanceof Number) {
return ((Number) value).intValue();
}
return 0;
} else if (expectedType.equals(Long.TYPE)) {
if (value instanceof Number) {
return ((Number) value).longValue();
}
return 0l;
} else if (expectedType.equals(Float.TYPE)) {
if (value instanceof Number) {
return ((Number) value).floatValue();
}
return 0.0f;
} else if (expectedType.equals(Double.TYPE)) {
if (value instanceof Number) {
return ((Number) value).doubleValue();
}
return 0.0d;
}
}
throw new IllegalArgumentException("expectedType was not a primitive type"); //$NON-NLS-1$
}
}

View file

@ -1,189 +0,0 @@
/*
* Copyright (c) 2014, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import org.eclipse.cdt.core.dom.ast.IASTFunctionCallExpression;
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IBasicType;
import org.eclipse.cdt.core.dom.ast.IEnumeration;
import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
/**
* Extracts required information from FunctionCallExpressions that call
* QObject::connect. This implementation handles all overloads of QObject::connect
* except the QMetaMethod related ones. QMetaMethods cannot be statically analyzed
* so they are ignored.
* <p>
* The binding is found by identifying the overload and then looking at the appropriate
* parameters.
*/
public class QtFunctionCall {
private QtFunctionCall() {
}
/**
* Returns a collection of all Qt method references within the given function call. Returns
* null if there are no Qt method references.
*/
public static Collection<QtMethodReference> getReferences(IASTFunctionCallExpression call) {
ICPPFunction function = ASTUtil.resolveFunctionBinding(ICPPFunction.class, call);
if (function == null)
return null;
if (QtKeywords.is_QObject_connect(function))
return getReferencesInConnect(function, call);
if (QtKeywords.is_QObject_disconnect(function))
return getReferencesInDisconnect(function, call);
return null;
}
private static Collection<QtMethodReference> getReferencesInConnect(ICPPFunction function,
IASTFunctionCallExpression call) {
if (function == null)
return null;
// There are 3 overloads of QObject::connect (Qt 4.8.4). They can be
// distinguished by examining
// the type of the forth parameter.
// connect( , , , const char *, )
// connect( , , , QMetaMethod&, )
// connect( , , , Qt::ConnectionType = )
ICPPParameter[] params = function.getParameters();
if (params.length < 4)
return null;
IASTInitializerClause[] args = call.getArguments();
IType type3 = ASTUtil.getBaseType(params[3].getType());
// static bool connect( const QObject *sender, const QMetaMethod &signal,
// const QObject *receiver, const QMetaMethod &method,
// Qt::ConnectionType type = Qt::AutoConnection )
if (QtKeywords.isQMetaMethod(type3)) {
// QMetaMethod cannot be statically analyzed.
return null;
}
// Otherwise find the signal and member parameters based on the overload.
QtMethodReference signal = null;
QtMethodReference member = null;
// static bool connect( const QObject *sender, const char *signal,
// const QObject *receiver, const char *member,
// Qt::ConnectionType = Qt::AutoConnection );
if (type3 instanceof IBasicType && ((IBasicType) type3).getKind() == IBasicType.Kind.eChar) {
signal = QtMethodReference.parse(call, ASTUtil.getBaseType(safeArgsAt(args, 0)), safeArgsAt(args, 1));
member = QtMethodReference.parse(call, ASTUtil.getBaseType(safeArgsAt(args, 2)), safeArgsAt(args, 3));
}
// inline bool connect( const QObject *sender, const char *signal,
// const char *member,
// Qt::ConnectionType type = Qt::AutoConnection ) const;
else if (type3 instanceof IEnumeration) {
signal = QtMethodReference.parse(call, ASTUtil.getBaseType(safeArgsAt(args, 0)), safeArgsAt(args, 1));
member = QtMethodReference.parse(call, ASTUtil.getReceiverType(call), safeArgsAt(args, 2));
}
return mergeNonNull(signal, member);
}
private static Collection<QtMethodReference> getReferencesInDisconnect(ICPPFunction function,
IASTFunctionCallExpression call) {
if (function == null)
return null;
// There are 4 overloads of QObject::disconnect (Qt 4.8.4). They can be distinguished by examining
// the type of the second parameter. The number of parameters is used to disambiguate one conflict.
// disconnect( , const char *, , ) && 4 params
// disconnect( , QMetaMethod&, , )
// disconnect( , const QObject *, )
// disconnect( , const char * ) && 2 params
ICPPParameter[] params = function.getParameters();
if (params.length < 2)
return null;
IASTInitializerClause[] args = call.getArguments();
IType type1 = ASTUtil.getBaseType(params[1].getType());
// static bool disconnect( const QObject *sender, const QMetaMethod &signal,
// const QObject *receiver, const QMetaMethod &member );
if (QtKeywords.isQMetaMethod(type1)) {
// QMetaMethod cannot be statically analyzed.
return Collections.emptyList();
}
// Otherwise find the signal and member parameters based on the overload.
QtMethodReference signal = null;
QtMethodReference member = null;
if (type1 instanceof IBasicType && ((IBasicType) type1).getKind() == IBasicType.Kind.eChar) {
switch (params.length) {
// static bool disconnect( const QObject *sender, const char *signal,
// const QObject *receiver, const char *member );
case 4:
signal = QtMethodReference.parse(call, ASTUtil.getBaseType(safeArgsAt(args, 0)), safeArgsAt(args, 1));
member = QtMethodReference.parse(call, ASTUtil.getBaseType(safeArgsAt(args, 2)), safeArgsAt(args, 3));
break;
// inline bool disconnect( const QObject *receiver, const char *member = 0 );
case 2:
member = QtMethodReference.parse(call, ASTUtil.getBaseType(safeArgsAt(args, 0)), safeArgsAt(args, 1));
break;
}
}
// inline bool disconnect( const char *signal = 0,
// const QObject *receiver = 0, const char *member = 0 );
else if (QtKeywords.isQObject(type1)) {
ICPPClassType recvr = ASTUtil.getReceiverType(call);
signal = QtMethodReference.parse(call, recvr, safeArgsAt(args, 0));
member = QtMethodReference.parse(call, ASTUtil.getBaseType(safeArgsAt(args, 1)), safeArgsAt(args, 2));
}
return mergeNonNull(signal, member);
}
private static IASTNode safeArgsAt(IASTNode[] args, int index) {
return args.length > index ? args[index] : null;
}
private static <T> Collection<T> mergeNonNull(T... withNulls) {
T firstNonNull = null;
ArrayList<T> list = null;
for (T t : withNulls) {
if (t == null)
continue;
else if (list != null)
list.add(t);
else if (firstNonNull == null)
firstNonNull = t;
else {
list = new ArrayList<>(withNulls.length);
list.add(firstNonNull);
list.add(t);
}
}
if (list != null)
return list;
if (firstNonNull != null)
return Collections.singletonList(firstNonNull);
return null;
}
}

View file

@ -1,130 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.cdt.core.dom.ast.IASTCompletionContext;
import org.eclipse.cdt.core.dom.ast.IASTFunctionCallExpression;
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IType;
/**
* Utility for managing interaction with QObject::connect and QObject::disconnect function
* calls. These function calls can contain two expansions. The first is always SIGNAL,
* the second is either SIGNAL (which will cause the second signal to be emitted when the
* first is received) or SLOT (which will cause the slot to be evaluate when the signal
* is received). This class follows the Qt convention of calling the first SIGNAL expansion
* the sender and the second (which could be SIGNAL or SLOT) the receiver.
*
* In the following examples, the type of the signal is the type of the q_sender variable.
* The type of the method is the type of the q_receiver variable. The variable q_unrelated is
* some instance that is not needed for either case.
* <pre>
* QObject::connect( q_sender, SIGNAL(destroyed()), q_receiver, SIGNAL() );
* QObject::connect( q_sender, SIGNAL(destroyed()), q_receiver, SLOT(deleteLater()) );
* QObject::connect( q_sender, SIGNAL(destroyed()), q_receiver, SIGNAL(), Qt::AutoConnection );
* QObject::connect( q_sender, SIGNAL(destroyed()), q_receiver, SLOT(deleteLater()), Qt::AutoConnection );
* q_unrelated->connect( q_sender, SIGNAL(destroyed()), q_receiver, SIGNAL() );
* q_unrelated->connect( q_sender, SIGNAL(destroyed()), q_receiver, SLOT(deleteLater()) );
* q_unrelated->connect( q_sender, SIGNAL(destroyed()), q_receiver, SIGNAL(), Qt::AutoConnection );
* q_unrelated->connect( q_sender, SIGNAL(destroyed()), q_receiver, SLOT(deleteLater()), Qt::AutoConnection );
*
* q_receiver->connect( q_sender, SIGNAL(destroyed()), SIGNAL() );
* q_receiver->connect( q_sender, SIGNAL(destroyed()), SLOT() );
* q_receiver->connect( q_sender, SIGNAL(destroyed()), SIGNAL(), Qt::AutoConnection );
* q_receiver->connect( q_sender, SIGNAL(destroyed()), SLOT(), Qt::AutoConnection );
*
* QObject::disconnect( q_sender, SIGNAL(), q_receiver, SIGNAL() );
* QObject::disconnect( q_sender, SIGNAL(), q_receiver, SLOT() );
* q_unrelated->disconnect( q_sender, SIGNAL(), q_receiver, SIGNAL() );
* q_unrelated->disconnect( q_sender, SIGNAL(), q_receiver, SLOT() );
*
* q_sender->disconnect( SIGNAL(), q_receiver, SIGNAL() );
* q_sender->disconnect( SIGNAL(), q_receiver, SLOT() );
* q_sender->disconnect( SIGNAL(), q_receiver );
* q_sender->disconnect( SIGNAL() );
* q_sender->disconnect();
* </pre>
*/
public class QtFunctionCallUtil {
private static final Pattern SignalRegex = Pattern.compile("^\\s*" + QtKeywords.SIGNAL + ".*"); //$NON-NLS-1$ //$NON-NLS-2$
private static final Pattern MethodRegex = Pattern
.compile("^\\s*(?:" + QtKeywords.SIGNAL + '|' + QtKeywords.SLOT + ").*"); //$NON-NLS-1$ //$NON-NLS-2$
/**
* Return true if the specified name is a QObject::connect or QObject::disconnect function
* and false otherwise.
*/
public static boolean isQObjectFunctionCall(IASTCompletionContext astContext, boolean isPrefix, IASTName name) {
if (name == null || name.getSimpleID() == null || name.getSimpleID().length <= 0)
return false;
// Bug332201: Qt content assist should always be applied to the most specific part of
// the target name.
IBinding[] funcBindings = astContext.findBindings(name.getLastName(), isPrefix);
for (IBinding funcBinding : funcBindings)
if (QtKeywords.is_QObject_connect(funcBinding) || QtKeywords.is_QObject_disconnect(funcBinding))
return true;
return false;
}
/**
* If the given argument is a SIGNAL or SLOT expansion then find and return the node in the AST
* that will be used for this method. Returns null if the argument is not a Qt method call or
* if the associated node cannot be found.
*/
public static IType getTargetType(IASTFunctionCallExpression call, IASTInitializerClause[] args, int argIndex) {
int sigExpIndex = getExpansionArgIndex(args, 0, SignalRegex);
if (argIndex == sigExpIndex)
return getSignalTargetType(sigExpIndex, call, args);
int methodExpIndex = getExpansionArgIndex(args, sigExpIndex + 1, MethodRegex);
if (argIndex == methodExpIndex)
return getMethodTargetType(methodExpIndex, sigExpIndex, call, args);
// Otherwise the given argument is not a SIGNAL or SLOT expansion.
return null;
}
private static IType getSignalTargetType(int sigExpIndex, IASTFunctionCallExpression call,
IASTInitializerClause[] args) {
// When the SIGNAL expansion is first, the type is based on the receiver of
// the function call. Otherwise the type is the previous argument.
return ASTUtil.getBaseType(sigExpIndex == 0 ? call : args[sigExpIndex - 1]);
}
private static IType getMethodTargetType(int methodExpIndex, int sigExpIndex, IASTFunctionCallExpression call,
IASTInitializerClause[] args) {
// If the method is right after the signal, then the type is based on the receiver
// of the function call. Otherwise the method type is based on the parameter right
// before the expansion.
if (methodExpIndex == (sigExpIndex + 1))
return ASTUtil.getReceiverType(call);
return ASTUtil.getBaseType(args[methodExpIndex - 1]);
}
private static int getExpansionArgIndex(IASTInitializerClause[] args, int begin, Pattern macroNameRegex) {
for (int i = begin; i < args.length; ++i) {
IASTInitializerClause arg = args[i];
String raw = arg.getRawSignature();
Matcher m = macroNameRegex.matcher(raw);
if (m.matches())
return i;
}
return -1;
}
}

View file

@ -1,277 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsSerializableProvider;
import org.eclipse.cdt.core.settings.model.CIncludePathEntry;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
import org.eclipse.cdt.core.settings.model.ICSettingEntry;
import org.eclipse.cdt.utils.spawner.ProcessFactory;
import org.eclipse.core.resources.IResource;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
/**
* Discovers and persists the list of Qt include paths for a particular installation of
* Qt. The Qt installation is described by the path to qmake.
* <p>
* Qt uses a tool called qmake to generate makefiles for Qt projects. The tool has a
* query mode that can be used to discover information about the Qt installation. Here
* qmake is used to build a list of all installed Qt include paths.
* <p>
* These paths are persisted into a file called language-settings.xml in the workspace
* metadata area.
*
* @see QtIncludePathsProvider
*/
public class QtIncludePaths extends LanguageSettingsSerializableProvider {
/**
* The path to the qmake executable uniquely identifies this installation.
*/
private final String qmakePath;
/**
* The cached data is reloaded when the qmake executable is modified.
*/
private long qmakeModTime;
/**
* The cached data is reloaded when the folder holding the include paths
* is removed.
*/
private String qtInstallHeadersPath;
/**
* The cached data is reloaded when the folder containing the include folders is
* modified.
*/
private long qtInstallHeadersModTime;
private static final String ATTR_QMAKE = "qmake"; //$NON-NLS-1$
private static final String ATTR_QMAKE_MOD = "qmakeModification"; //$NON-NLS-1$
private static final String ATTR_QT_INSTALL_HEADERS = "QT_INSTALL_HEADERS"; //$NON-NLS-1$
private static final String ATTR_QT_INSTALL_HEADERS_MOD = "qtInstallHeadersModification"; //$NON-NLS-1$
/**
* Create a new instance of the include path wrapper for the Qt installation for
* the given qmake binary.
*/
public QtIncludePaths(String qmakePath) {
this.qmakePath = qmakePath;
}
/**
* Create and load an instance of QtIncludePaths from data that was serialized into the
* given XML element. Return null if an instance cannot be loaded or if the installation
* is no longer valid.
*/
public static QtIncludePaths loadFrom(Node node) {
if (node.getNodeType() != Node.ELEMENT_NODE)
return null;
Element element = (Element) node;
String qmakePath = element.getAttribute(ATTR_QMAKE);
if (qmakePath == null || qmakePath.isEmpty())
return null;
QtIncludePaths qtIncludePaths = new QtIncludePaths(qmakePath);
qtIncludePaths.load(element);
return qtIncludePaths;
}
public String getQMakePath() {
return qmakePath;
}
/**
* Return true if the receiver points to a valid Qt installation and false otherwise.
* The installation is considered valid if an executable qmake binary exists at the
* expected location.
*/
public boolean isValid() {
if (qmakePath == null || qmakePath.isEmpty())
return false;
File qmake = new File(qmakePath);
return qmake.exists() && qmake.canExecute();
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof QtIncludePaths))
return super.equals(obj);
// Include paths are equivalent when they point to the same qmake binary. All other
// values are reloaded from that binary and do not need to be directly compared.
QtIncludePaths other = (QtIncludePaths) obj;
return qmakePath == null ? other.qmakePath == null : qmakePath.equals(other.qmakePath);
}
@Override
public int hashCode() {
return qmakePath == null ? 0 : qmakePath.hashCode();
}
/**
* Return a current list of the include paths for this Qt installation. Return null if
* no such paths can be found.
* <p>
* Updates the cached results if needed. If the settings are updated then the new list
* will be serialized into the workspace metadata area.
*/
@Override
public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription configDesc, IResource rc,
String languageId) {
List<ICLanguageSettingEntry> entries = null;
File qmake = new File(qmakePath);
if (!qmake.exists() || qmakeModTime != qmake.lastModified())
entries = reload();
else {
File qtInstallHeadersDir = new File(qtInstallHeadersPath);
if (!qtInstallHeadersDir.exists() || qtInstallHeadersModTime != qtInstallHeadersDir.lastModified())
entries = reload();
}
// If the cache was not reloaded, then return the previously discovered entries.
if (entries == null)
return super.getSettingEntries(configDesc, rc, languageId);
// Otherwise store, persist, and return the newly discovered values.
setSettingEntries(configDesc, rc, languageId, entries);
serializeLanguageSettingsInBackground(null);
return entries;
}
@Override
public Element serializeAttributes(Element parentElement) {
parentElement.setAttribute(ATTR_QMAKE, qmakePath);
parentElement.setAttribute(ATTR_QMAKE_MOD, Long.toString(qmakeModTime));
parentElement.setAttribute(ATTR_QT_INSTALL_HEADERS, qtInstallHeadersPath);
parentElement.setAttribute(ATTR_QT_INSTALL_HEADERS_MOD, Long.toString(qtInstallHeadersModTime));
// The parent implementation tries to create a new child node (provider) that is used
// as the part for later entries. This isn't needed in this case, we just want to
// use the part that serializes the languages.
return parentElement;
}
@Override
public void loadAttributes(Element element) {
qmakeModTime = getLongAttribute(element, ATTR_QMAKE_MOD);
qtInstallHeadersPath = element.getAttribute(ATTR_QT_INSTALL_HEADERS);
qtInstallHeadersModTime = getLongAttribute(element, ATTR_QT_INSTALL_HEADERS_MOD);
// The parent implementation tries to create a new child node (provider) that is used
// as the part for later entries. This isn't needed in this case, we just want to
// use the part that serializes the languages.
}
/**
* Parse and return the given attribute as a long. Return 0 if the attribute does
* not have a valid value.
*/
private static long getLongAttribute(Element element, String attr) {
String value = element.getAttribute(attr);
if (value == null || value.isEmpty())
return 0;
try {
return Long.parseLong(value);
} catch (NumberFormatException e) {
Activator.log("attribute name:" + attr + " value:" + value, e); //$NON-NLS-1$ //$NON-NLS-2$
return 0;
}
}
/**
* Reload and return the entries if possible, return null otherwise.
*/
private List<ICLanguageSettingEntry> reload() {
// All keys are reset and then updated as their values are discovered. This allows partial
// success to skip over previously calculated values.
qmakeModTime = 0;
qtInstallHeadersPath = null;
qtInstallHeadersModTime = 0;
File qmake = new File(qmakePath);
if (!qmake.exists() || !qmake.canExecute())
return Collections.emptyList();
qmakeModTime = qmake.lastModified();
// Run `qmake -query QT_INSTALL_HEADERS` to get output like "/opt/qt-5.0.0/include".
BufferedReader reader = null;
Process process = null;
try {
process = ProcessFactory.getFactory().exec(new String[] { qmakePath, "-query", "QT_INSTALL_HEADERS" }); //$NON-NLS-1$ //$NON-NLS-2$
reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
qtInstallHeadersPath = reader.readLine();
} catch (IOException e) {
Activator.log(e);
} finally {
try {
if (reader != null)
reader.close();
} catch (IOException e) {
/* ignore */
} finally {
if (process != null)
process.destroy();
}
}
if (qtInstallHeadersPath == null)
return Collections.emptyList();
File qtInstallHeadersDir = new File(qtInstallHeadersPath);
qtInstallHeadersModTime = qtInstallHeadersDir.lastModified();
if (!qtInstallHeadersDir.exists() || !qtInstallHeadersDir.canRead() || !qtInstallHeadersDir.isDirectory())
return Collections.emptyList();
// Create an include path entry for all sub-folders in the QT_INSTALL_HEADERS location, including
// the QT_INSTALL_HEADERS folder itself.
File[] files = qtInstallHeadersDir.listFiles(new FileFilter() {
@Override
public boolean accept(File pathname) {
return pathname.exists() && pathname.isDirectory();
}
});
List<ICLanguageSettingEntry> entries = new ArrayList<>(files.length + 1);
safeAdd(entries, qtInstallHeadersDir);
for (File file : files)
safeAdd(entries, file);
return entries;
}
private static void safeAdd(List<ICLanguageSettingEntry> entries, File file) {
try {
entries.add(
new CIncludePathEntry(file.getCanonicalPath(), ICSettingEntry.READONLY | ICSettingEntry.RESOLVED));
} catch (IOException e) {
Activator.log(e);
}
}
}

View file

@ -1,137 +0,0 @@
/*
* Copyright (c) 2013 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsSerializableProvider;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
import org.eclipse.core.resources.IResource;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
* This provider uses persistent cache to store the include paths for different
* Qt installations. A Qt installation is uniquely identified by the path to
* the qmake binary within the installation.
* <p>
* This result is shared among all Build Configurations that use the provider
* with the same value for the QMAKE environment variable.
*/
public class QtIncludePathsProvider extends LanguageSettingsSerializableProvider {
/**
* The provider identifies Qt installations by the absolute path to the qmake binary. The
* include paths relevant to the installations are computed and persisted in {@link QtIncludePaths}.
*/
private final Map<String, QtIncludePaths> qtInstallHeaders = new HashMap<>();
/**
* The build configuration stores the path to the qmake binary as an environment variable.
*/
private static final String ENVVAR_QMAKE = "QMAKE"; //$NON-NLS-1$
private static final String ELEMENT_QMAKE = "qmake"; //$NON-NLS-1$
@Override
public boolean equals(Object obj) {
if (!(obj instanceof QtIncludePathsProvider))
return super.equals(obj);
/**
* Providers are equal when they have the same cached values.
*/
QtIncludePathsProvider other = (QtIncludePathsProvider) obj;
if (qtInstallHeaders == null)
return other.qtInstallHeaders == null;
return qtInstallHeaders.equals(other.qtInstallHeaders);
}
@Override
public int hashCode() {
return qtInstallHeaders == null ? 0 : qtInstallHeaders.hashCode();
}
@Override
public void loadEntries(Element providerNode) {
super.loadEntries(providerNode);
// Find and load all qmake child nodes. There will be one node for each Qt
// installation that has been used. Qt installations that are no longer valid
// are not loaded. This means they will be removed from the file the next time
// that the language setting providers are serialized.
NodeList children = providerNode.getChildNodes();
for (int i = 0; i < children.getLength(); ++i) {
Node child = children.item(i);
if (ELEMENT_QMAKE.equals(child.getNodeName())) {
QtIncludePaths qtIncludePaths = QtIncludePaths.loadFrom(child);
if (qtIncludePaths != null && qtIncludePaths.isValid())
qtInstallHeaders.put(qtIncludePaths.getQMakePath(), qtIncludePaths);
}
}
}
@Override
public void serializeEntries(Element parent) {
// NOTE: This creates its own XML structure where children of the provider node are qmake nodes.
// Within each qmake node is a list of include paths for that installation. Calling the
// base #serializeEntries here would try to write this instance's (empty) list of settings
// to the file.
// Each value is serialized into a new element in the XML document.
Document document = parent instanceof Document ? (Document) parent : parent.getOwnerDocument();
for (QtIncludePaths qtIncludePaths : qtInstallHeaders.values()) {
Element child = document.createElement(ELEMENT_QMAKE);
qtIncludePaths.serialize(child);
parent.appendChild(child);
}
}
/**
* The given build configuration's QMAKE environment variable is used to identify the appropriate
* Qt installation. The language settings are then either returned from the previously persisted
* data or loaded, serialized, and returned.
*/
@Override
public synchronized List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription configDesc,
IResource rc, String languageId) {
// Make sure the requested language is in scope for this provider.
if (!getLanguageScope().contains(languageId))
return null;
// The value of the build configuration's QMAKE environment variable is used to select the
// right version of qmake.
IEnvironmentVariable qmake_var = CCorePlugin.getDefault().getBuildEnvironmentManager().getVariable(ENVVAR_QMAKE,
configDesc, true);
if (qmake_var == null)
return null;
String qmake = qmake_var.getValue();
if (qmake == null)
return null;
// The path to qmake is used as the key into the in-memory cache of header paths.
QtIncludePaths paths = qtInstallHeaders.get(qmake);
if (paths == null) {
paths = new QtIncludePaths(qmake);
qtInstallHeaders.put(qmake, paths);
}
return paths.getSettingEntries(configDesc, null, languageId);
}
}

View file

@ -1,84 +0,0 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.cdt.internal.qt.core;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.cdt.qt.core.IQtInstall;
public class QtInstall implements IQtInstall {
private final Path qmakePath;
private String spec;
private Map<String, String> properties = new HashMap<>();
public QtInstall(Path qmakePath) {
this.qmakePath = qmakePath;
}
@Override
public Path getQmakePath() {
return qmakePath;
}
@Override
public Path getLibPath() {
return qmakePath.resolve("../lib"); //$NON-NLS-1$
}
@Override
public Path getQmlPath() {
return qmakePath.resolve("../../qml"); //$NON-NLS-1$
}
public static String getSpec(Path qmakePath) throws IOException {
if (Files.exists(qmakePath)) {
Process proc = new ProcessBuilder(qmakePath.toString(), "-query", "QMAKE_XSPEC").start(); //$NON-NLS-1$ //$NON-NLS-2$
try (BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream()))) {
String line = reader.readLine();
if (line != null) {
return line.trim();
}
}
}
return null;
}
@Override
public String getSpec() {
if (spec == null) {
try {
spec = getSpec(getQmakePath());
} catch (IOException e) {
Activator.log(e);
}
}
return spec;
}
@Override
public void setProperty(String key, String value) {
properties.put(key, value);
}
@Override
public Map<String, String> getProperties() {
return Collections.unmodifiableMap(properties);
}
}

View file

@ -1,195 +0,0 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.cdt.internal.qt.core;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.eclipse.cdt.core.build.IToolChain;
import org.eclipse.cdt.qt.core.IQtInstall;
import org.eclipse.cdt.qt.core.IQtInstallListener;
import org.eclipse.cdt.qt.core.IQtInstallManager;
import org.eclipse.cdt.qt.core.IQtInstallProvider;
import org.eclipse.cdt.qt.core.QtInstallEvent;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.osgi.service.prefs.BackingStoreException;
import org.osgi.service.prefs.Preferences;
public class QtInstallManager implements IQtInstallManager {
private Map<Path, IQtInstall> installs;
private Map<String, IConfigurationElement> toolChainMap;
private List<IQtInstallListener> listeners = new LinkedList<>();
private Preferences getPreferences() {
return InstanceScope.INSTANCE.getNode(Activator.ID).node("qtInstalls"); //$NON-NLS-1$
}
private void initInstalls() {
if (installs == null) {
installs = new HashMap<>();
try {
Preferences prefs = getPreferences();
for (String key : prefs.keys()) {
QtInstall install = new QtInstall(Paths.get(prefs.get(key, "/"))); //$NON-NLS-1$
installs.put(install.getQmakePath(), install);
}
} catch (BackingStoreException e) {
Activator.log(e);
}
// Auto installs
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(Activator.ID,
"qtInstallProvider"); //$NON-NLS-1$
for (IConfigurationElement element : point.getConfigurationElements()) {
try {
IQtInstallProvider provider = (IQtInstallProvider) element.createExecutableExtension("class"); //$NON-NLS-1$
for (IQtInstall install : provider.getInstalls()) {
installs.put(install.getQmakePath(), install);
}
} catch (CoreException e) {
Activator.log(e);
}
}
}
}
private void saveInstalls() {
try {
Preferences prefs = getPreferences();
// Remove ones that aren't valid
for (String key : prefs.keys()) {
if (installs.get(Paths.get(key)) == null) {
prefs.remove(key);
}
}
// Add new ones
for (Path path : installs.keySet()) {
String key = path.toString();
if (prefs.get(key, null) == null) {
prefs.put(key, installs.get(path).getQmakePath().toString());
}
}
prefs.flush();
} catch (BackingStoreException e) {
Activator.log(e);
}
}
@Override
public Collection<IQtInstall> getInstalls() {
initInstalls();
return Collections.unmodifiableCollection(installs.values());
}
@Override
public void addInstall(IQtInstall qt) {
initInstalls();
installs.put(qt.getQmakePath(), qt);
saveInstalls();
}
@Override
public IQtInstall getInstall(Path qmakePath) {
initInstalls();
return installs.get(qmakePath);
}
@Override
public Collection<IQtInstall> getInstall(String spec) {
initInstalls();
List<IQtInstall> installList = new ArrayList<>();
for (IQtInstall install : installs.values()) {
if (install.getSpec().equals(spec)) {
installList.add(install);
}
}
return installList;
}
@Override
public void removeInstall(IQtInstall install) {
fireEvent(new QtInstallEvent(QtInstallEvent.REMOVED, install));
installs.remove(install.getQmakePath());
saveInstalls();
}
@Override
public boolean supports(IQtInstall install, IToolChain toolChain) {
if (toolChainMap == null) {
toolChainMap = new HashMap<>();
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(Activator.ID,
"qtToolChainMapper"); //$NON-NLS-1$
for (IConfigurationElement element : point.getConfigurationElements()) {
if (element.getName().equals("mapping")) { //$NON-NLS-1$
String spec = element.getAttribute("spec"); //$NON-NLS-1$
toolChainMap.put(spec, element);
}
}
}
IConfigurationElement element = toolChainMap.get(install.getSpec());
if (element != null) {
for (IConfigurationElement property : element.getChildren("property")) { //$NON-NLS-1$
String key = property.getAttribute("key"); //$NON-NLS-1$
String value = property.getAttribute("value"); //$NON-NLS-1$
if (!value.equals(toolChain.getProperty(key))) {
return false;
}
}
for (Entry<String, String> property : install.getProperties().entrySet()) {
String tcValue = toolChain.getProperty(property.getKey());
// Treat null as a wildcard
if (tcValue != null && !property.getValue().equals(tcValue)) {
return false;
}
}
return true;
} else {
// Don't know so returning false
return false;
}
}
@Override
public void addListener(IQtInstallListener listener) {
listeners.add(listener);
}
@Override
public void removeListener(IQtInstallListener listener) {
listeners.remove(listener);
}
private void fireEvent(QtInstallEvent event) {
for (IQtInstallListener listener : listeners) {
listener.installChanged(event);
}
}
}

View file

@ -1,111 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core;
import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
/**
* Declares constants related to tokens that are special in Qt applications.
*/
public class QtKeywords {
public static final String CONNECT = "connect"; //$NON-NLS-1$
public static final String DISCONNECT = "disconnect"; //$NON-NLS-1$
public static final String Q_CLASSINFO = "Q_CLASSINFO"; //$NON-NLS-1$
public static final String Q_DECLARE_FLAGS = "Q_DECLARE_FLAGS"; //$NON-NLS-1$
public static final String Q_ENUMS = "Q_ENUMS"; //$NON-NLS-1$
public static final String Q_FLAGS = "Q_FLAGS"; //$NON-NLS-1$
public static final String Q_GADGET = "Q_GADGET"; //$NON-NLS-1$
public static final String Q_INVOKABLE = "Q_INVOKABLE"; //$NON-NLS-1$
public static final String Q_OBJECT = "Q_OBJECT"; //$NON-NLS-1$
public static final String Q_PROPERTY = "Q_PROPERTY"; //$NON-NLS-1$
public static final String Q_REVISION = "Q_REVISION"; //$NON-NLS-1$
public static final String Q_SIGNAL = "Q_SIGNAL"; //$NON-NLS-1$
public static final String Q_SIGNALS = "Q_SIGNALS"; //$NON-NLS-1$
public static final String Q_SLOT = "Q_SLOT"; //$NON-NLS-1$
public static final String Q_SLOTS = "Q_SLOTS"; //$NON-NLS-1$
public static final String QMETAMETHOD = "QMetaMethod"; //$NON-NLS-1$
public static final String QML_ATTACHED_PROPERTIES = "qmlAttachedProperties"; //$NON-NLS-1$
public static final String QML_REGISTER_TYPE = "qmlRegisterType"; //$NON-NLS-1$
public static final String QML_REGISTER_UNCREATABLE_TYPE = "qmlRegisterUncreatableType"; //$NON-NLS-1$
public static final String QOBJECT = "QObject"; //$NON-NLS-1$
public static final String SIGNAL = "SIGNAL"; //$NON-NLS-1$
public static final String SIGNALS = "signals"; //$NON-NLS-1$
public static final String SLOT = "SLOT"; //$NON-NLS-1$
public static final String SLOTS = "slots"; //$NON-NLS-1$
/**
* Returns true if the argument type is for Qt's QObject class and false otherwise.
*/
public static boolean isQObject(IType type) {
if (!(type instanceof ICPPClassType))
return false;
ICPPClassType clsType = (ICPPClassType) type;
return QtKeywords.QOBJECT.equals(clsType.getName());
}
/**
* Returns true if the argument type is for Qt's QMetaMethod class and false otherwise.
*/
public static boolean isQMetaMethod(IType type) {
if (!(type instanceof ICPPClassType))
return false;
ICPPClassType clsType = (ICPPClassType) type;
return QMETAMETHOD.equals(clsType.getName());
}
/**
* Returns true if the argument binding is for the QObject::connect function
* and false otherwise.
*/
public static boolean is_QObject_connect(IBinding binding) {
String[] qualName = getFunctionQualifiedName(binding);
return qualName != null && qualName.length == 2 && QOBJECT.equals(qualName[0]) && CONNECT.equals(qualName[1]);
}
/**
* Returns true if the argument binding is for the QObject::disconnect function
* and false otherwise.
*/
public static boolean is_QObject_disconnect(IBinding binding) {
String[] qualName = getFunctionQualifiedName(binding);
return qualName != null && qualName.length == 2 && QOBJECT.equals(qualName[0])
&& DISCONNECT.equals(qualName[1]);
}
/**
* Returns true if the given binding will register a type with the QML type system and false
* otherwise.
*/
public static boolean is_QmlType(IBinding binding) {
String[] qualName = getFunctionQualifiedName(binding);
return qualName != null && qualName.length == 1
&& (QML_REGISTER_TYPE.equals(qualName[0]) || QML_REGISTER_UNCREATABLE_TYPE.equals(qualName[0]));
}
private static String[] getFunctionQualifiedName(IBinding binding) {
// IBinding#getAdapter returns null when binding is an instance of
// PDOMCPPMethod.
if (binding instanceof ICPPFunction)
try {
return ((ICPPFunction) binding).getQualifiedName();
} catch (DOMException e) {
Activator.log(e);
}
return null;
}
}

View file

@ -1,226 +0,0 @@
/*
* Copyright (c) 2014, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core;
import java.util.regex.Matcher;
import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTFileLocation;
import org.eclipse.cdt.core.dom.ast.IASTMacroExpansionLocation;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTNodeLocation;
import org.eclipse.cdt.core.dom.ast.IASTPreprocessorMacroDefinition;
import org.eclipse.cdt.core.dom.ast.IASTPreprocessorMacroExpansion;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics;
import org.eclipse.cdt.internal.qt.core.index.IQMethod;
import org.eclipse.cdt.internal.qt.core.index.IQObject;
import org.eclipse.cdt.internal.qt.core.index.QtIndex;
import org.eclipse.cdt.internal.qt.core.pdom.ASTNameReference;
import org.eclipse.cdt.internal.qt.core.pdom.QtASTImageLocation;
import org.eclipse.core.resources.IProject;
/**
* Qt signals and slots are referenced using the SIGNAL and SLOT macros. The expansion
* parameter is the signature of the signal or slot and they are associated with a type.
* This utility class is used to convert from these AST nodes to an IASTName that can be
* used as a reference to the IBinding for the C++ method.
*/
@SuppressWarnings("restriction")
public class QtMethodReference extends ASTNameReference {
public static enum Type {
Signal("sender", "SIGNAL", "signal"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
Slot("receiver", "SLOT", "member"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
public final String roleName;
public final String macroName;
public final String paramName;
public boolean matches(Type other) {
if (other == null)
return false;
// The signal parameter must be a SIGNAL, but the slot could be a
// SLOT or a SIGNAL.
return this == Signal ? other == Signal : true;
}
/**
* Return the type of method reference within the expansion of the given macro name.
*/
public static Type from(IASTName name) {
String nameStr = String.valueOf(name);
if (QtKeywords.SIGNAL.equals(nameStr))
return Signal;
if (QtKeywords.SLOT.equals(nameStr))
return Slot;
return null;
}
private Type(String roleName, String macroName, String paramName) {
this.roleName = roleName;
this.macroName = macroName;
this.paramName = paramName;
}
}
private final Type type;
private final ICPPClassType cls;
private final String expansionParam;
private QtMethodReference(Type type, ICPPClassType cls, IASTName macroRefName, String expansionParam,
IASTFileLocation location) {
super(macroRefName, location);
this.type = type;
this.cls = cls;
this.expansionParam = expansionParam;
}
/**
* Return the C++ class that defines the Qt method that is being referenced.
*/
public ICPPClassType getContainingType() {
return cls;
}
/**
* Look for SIGNAL or SLOT macro expansions at the location of the given node. Return the
* QMethod reference is an expansion is found and null otherwise.
* <p>
* QMetaMethod references cannot be statically resolved so null will be returned in this case.
*/
public static QtMethodReference parse(IASTNode parent, IType cppType, IASTNode arg) {
if (!(cppType instanceof ICPPClassType) || arg == null)
return null;
ICPPClassType cls = (ICPPClassType) cppType;
// Look for a SIGNAL or SLOT expansion as this location.
Type type = null;
IASTName macroReferenceName = null;
for (IASTNodeLocation location : arg.getNodeLocations()) {
if (!(location instanceof IASTMacroExpansionLocation))
continue;
IASTPreprocessorMacroExpansion expansion = ((IASTMacroExpansionLocation) location).getExpansion();
macroReferenceName = expansion.getMacroReference();
IASTPreprocessorMacroDefinition macroDefn = expansion.getMacroDefinition();
type = Type.from(macroDefn.getName());
if (type != null)
break;
}
// There is nothing to do if the expected type of expansion is not found.
if (macroReferenceName == null || type == null)
return null;
// This check will miss cases like:
// #define MY_SIG1 SIGNAL
// #define MY_SIG2(s) SIGNAL(s)
// #define MY_SIG3(s) SIGNAL(signal())
// connect( &a, MY_SIG1(signal()), ...
// connect( &a, MY_SIG2(signal()), ...
// connect( &a, MY_SIG2, ...
// This could be improved by adding tests when arg represents a macro expansion. However, I'm
// not sure if we would be able to follow the more complicated case of macros that call functions
// that use the SIGNAL macro. For now I've implemented the simpler check of forcing the call to
// use the SIGNAL/SLOT macro directly.
String raw = arg.getRawSignature();
Matcher m = ASTUtil.Regex_MacroExpansion.matcher(raw);
if (!m.matches())
return null;
// Get the argument to the SIGNAL/SLOT macro and the offset/length of that argument within the
// complete function argument. E.g., with this argument to QObject::connect
// SIGNAL( signal(int) )
// the values are
// expansionArgs: "signal(int)"
// expansionOffset: 8
// expansionLength: 11
String expansionArgs = m.group(2);
int expansionOffset = m.start(2);
int expansionLength = m.end(2) - expansionOffset;
IASTFileLocation location = new QtASTImageLocation(macroReferenceName.getFileLocation(), expansionOffset,
expansionLength);
return new QtMethodReference(type, cls, macroReferenceName, expansionArgs, location);
}
public Type getType() {
return type;
}
@Override
public String getRawSignature() {
return expansionParam;
}
@Override
public char[] getSimpleID() {
return expansionParam.toCharArray();
}
private IQObject findQObject() {
String[] qualName = null;
try {
qualName = cls.getQualifiedName();
} catch (DOMException e) {
Activator.log(e);
}
IProject project = ASTUtil.getProject(delegate);
if (project == null)
return null;
QtIndex qtIndex = QtIndex.getIndex(project);
if (qtIndex == null)
return null;
return qtIndex.findQObject(qualName);
}
public IQMethod getMethod() {
IQObject qobj = findQObject();
if (qobj == null)
return null;
// Return the first matching method.
for (IQMethod method : ASTUtil.findMethods(qobj, this))
return method;
return null;
}
@Override
public IBinding resolveBinding() {
if (binding != null)
return binding;
// Qt method references return the C++ method that is being referenced in the SIGNAL or
// SLOT macro expansion.
String methodName = expansionParam;
int paren = methodName.indexOf('(');
if (paren > 0)
methodName = methodName.substring(0, paren);
IBinding[] methods = CPPSemantics.findBindings(cls.getCompositeScope(), methodName.trim(), false);
// TODO find the one binding that matches the parameter of the macro expansion
// 1) Normalize expansionParam
// 2) Use it to filter the matching methods
binding = methods.length > 0 ? methods[0] : null;
return binding;
}
}

View file

@ -1,341 +0,0 @@
/*
* Copyright (c) 2013 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.xml.bind.DatatypeConverter;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTPointer;
import org.eclipse.cdt.core.dom.ast.IASTPointerOperator;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTDeclarator;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTParameterDeclaration;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTReferenceOperator;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateId;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTypeId;
import org.eclipse.cdt.internal.core.dom.parser.ASTAmbiguousNode;
import org.eclipse.cdt.internal.qt.core.parser.QtParser;
/**
* A collection of utility functions for dealing with Qt methods. A Qt method is a normal
* C++ method that has been annotated with empty macro expansions.
*/
@SuppressWarnings("restriction")
public class QtMethodUtil {
/**
* The Qt implementation uses specific rules for generating a signature that is used
* to map between invokable function declarations and their use. This function has
* be implemented by comparing the output of moc to the various test cases in the
* qt test suite.
*/
public static String getQtNormalizedMethodSignature(String signature) {
ICPPASTFunctionDeclarator function = QtParser.parseQtMethodReference(signature);
if (function == null)
return null;
// NOTE: This implementation (both here and in methods that are invoked) used call #getRawSignature
// to get the original tokens. This has been changed to use #toString instead. They seem to
// provide the same value, so this should be OK. The problem with #getRawSignature is that it
// looks for the characters in the file (using offset and length). There isn't a file backing
// the StringScanner, so the result is the empty String. If we find cases where #toString
// returns the wrong value, then this can be changed back to #getRawSignature. Implement the
// AST and LocationResolver to work with ASTNode#getRawSignatureChars:
// protected char[] getRawSignatureChars() {
// final IASTFileLocation floc= getFileLocation();
// final IASTTranslationUnit ast = getTranslationUnit();
// if (floc != null && ast != null) {
// ILocationResolver lr= (ILocationResolver) ast.getAdapter(ILocationResolver.class);
// if (lr != null) {
// return lr.getUnpreprocessedSignature(getFileLocation());
// }
// }
StringBuilder result = new StringBuilder();
// raw sig tries to find the file
String fnName = function.getName().getLastName().toString();
result.append(stripWS(fnName));
result.append('(');
boolean first = true;
for (ICPPASTParameterDeclaration param : function.getParameters()) {
if (first)
first = false;
else
result.append(',');
IASTDeclSpecifier spec = param.getDeclSpecifier();
ICPPASTDeclarator declarator = param.getDeclarator();
// The parameters are encoded so that we can rely on , being used to separate
// parameters. All other commas (e.g., to separate template arguments within
// the parameter type) will be encoded.
StringBuilder paramSig = new StringBuilder();
append(paramSig, spec, declarator, true);
result.append(stripWS(paramSig.toString()));
}
result.append(')');
// Whitespace around operators is not needed, remove it to normalize the signature.
return result.toString();
}
public static Collection<String> getDecodedQtMethodSignatures(String qtEncSignatures) {
if (qtEncSignatures == null)
return null;
StringBuilder signature = new StringBuilder();
int i = qtEncSignatures.indexOf('(');
String name = qtEncSignatures.substring(0, i);
signature.append(name);
signature.append('(');
boolean first = true;
List<String> signatures = new ArrayList<>();
qtEncSignatures = qtEncSignatures.substring(i + 1);
Pattern p = Pattern.compile("^([a-zA-Z0-9+/=]*)(@?).*$"); //$NON-NLS-1$
while (!qtEncSignatures.isEmpty()) {
Matcher m = p.matcher(qtEncSignatures);
if (!m.matches())
break;
int next = m.end(2) + 1;
qtEncSignatures = qtEncSignatures.substring(next);
String param = new String(DatatypeConverter.parseBase64Binary(m.group(1)));
// If this parameter has a default value, then add a signature for the method up
// to this point.
if (!m.group(2).isEmpty())
signatures.add(signature.toString() + ')');
if (first)
first = false;
else
signature.append(',');
signature.append(param);
}
signature.append(')');
signatures.add(signature.toString());
return signatures;
}
/**
* The Qt implementation has specific rules for generating a signature that is used
* to map between invokable function declarations and their use. This function has
* been implemented by comparing the output of moc to the various test cases in the
* Qt test suite.
*/
public static String getEncodedQtMethodSignatures(ICPPASTFunctionDeclarator function) {
StringBuilder result = new StringBuilder();
String fnName = function.getName().getLastName().toString();
result.append(stripWS(fnName));
result.append('(');
boolean first = true;
for (ICPPASTParameterDeclaration param : function.getParameters()) {
if (first)
first = false;
else
result.append(',');
IASTDeclSpecifier spec = param.getDeclSpecifier();
ICPPASTDeclarator declarator = param.getDeclarator();
// The parameters are encoded so that we can rely on , being used to separate
// parameters. All other commas (e.g., to separate template arguments within
// the parameter type) will be encoded.
StringBuilder paramSig = new StringBuilder();
append(paramSig, spec, declarator, true);
String paramStr = stripWS(paramSig.toString());
result.append(DatatypeConverter.printBase64Binary(paramStr.getBytes()));
// A special character is used as a suffix on parameters that have a default value.
// A previous version of this implementation used '=' within the Base64 encoded
// payload. Now that the initializer flag is outside of the payload, '=' is a bad
// choice because it is also a valid Base64 encoded character.
// Like all the other parts of this encoder, the @ must match the value that is used
// in the decoder.
if (declarator.getInitializer() != null)
result.append('@');
}
result.append(')');
// Whitespace around operators is not needed, remove it to normalize the signature.
return result.toString();
}
private static String stripWS(String str) {
return str.trim().replaceAll("\\s+", " "). //$NON-NLS-1$ //$NON-NLS-2$
replaceAll(" ([\\*&,()<>]+)", "$1"). //$NON-NLS-1$ //$NON-NLS-2$
replaceAll("([\\*&,()<>]+) ", "$1"); //$NON-NLS-1$ //$NON-NLS-2$
}
private static String asString(IASTPointerOperator ptr) {
if (ptr instanceof ICPPASTReferenceOperator)
return "&"; //$NON-NLS-1$
if (ptr instanceof IASTPointer) {
StringBuilder str = new StringBuilder();
IASTPointer astPtr = (IASTPointer) ptr;
str.append('*');
if (astPtr.isConst())
str.append(" const"); //$NON-NLS-1$
if (astPtr.isVolatile())
str.append(" volatile"); //$NON-NLS-1$
return str.toString();
}
return ptr.toString();
}
private static void append(StringBuilder result, IASTDeclSpecifier spec, IASTDeclarator declarator,
boolean pruneConst) {
IASTPointerOperator[] ptrs = declarator.getPointerOperators();
if (ptrs == null)
ptrs = new IASTPointerOperator[0];
if (!(spec instanceof ICPPASTDeclSpecifier)) {
result.append(spec.toString());
return;
}
ICPPASTDeclSpecifier cppSpec = (ICPPASTDeclSpecifier) spec;
// Qt considers the type const if it is marked as const, or if it is a reference
// and the previous pointer is const. I.e., we need this:
// const T& -> T
// const T* const & -> T*
boolean isConst = cppSpec.isConst();
boolean stripLastPtrConst = pruneConst && !isConst
&& (ptrs.length >= 2 && ptrs[ptrs.length - 1] instanceof ICPPASTReferenceOperator
&& ptrs[ptrs.length - 2] instanceof IASTPointer
&& ((IASTPointer) ptrs[ptrs.length - 2]).isConst());
if (isConst || stripLastPtrConst) {
if (!pruneConst)
result.append("const "); //$NON-NLS-1$
else {
// Qt signature generation converts const value and const reference types
// into simple value types. E.g.,
// const T => T
// const T & => T
// From observation, they also convert const pointer to const to const
// pointers although I think that is a bug, because simple pointer to
// const are not converted to simple pointers. E.g.,
// const T * => const T *
// const T * const => T * const
if (ptrs.length > 0) {
IASTPointerOperator lastPtr = ptrs[ptrs.length - 1];
if (lastPtr instanceof ICPPASTReferenceOperator)
ptrs = Arrays.copyOf(ptrs, ptrs.length - 1);
else if (!(lastPtr instanceof IASTPointer) || !((IASTPointer) lastPtr).isConst())
result.append("const "); //$NON-NLS-1$
}
}
}
// Qt does no special handling for volatile. This is likely an oversight.
if (cppSpec.isVolatile())
result.append("volatile "); //$NON-NLS-1$
IASTNode[] children = cppSpec.getChildren();
if (children == null || children.length <= 0) {
// We use the raw signature to get the text that was used to reference the
// type (without following typedefs, etc.), and then strip out all const
// which has already been handled.
String raw = cppSpec.toString();
raw = raw.replaceAll("const\\s", ""); //$NON-NLS-1$ //$NON-NLS-2$
raw = raw.replaceAll("\\sconst", ""); //$NON-NLS-1$ //$NON-NLS-2$
result.append(raw);
} else {
for (IASTNode child : children) {
result.append(' ');
if (child instanceof ICPPASTTemplateId) {
ICPPASTTemplateId templId = (ICPPASTTemplateId) child;
result.append(templId.getTemplateName());
result.append('<');
for (IASTNode templArg : templId.getTemplateArguments()) {
append(result, templArg);
}
result.append('>');
} else
result.append(child.toString());
}
}
// exclude param name, use '=' to indicate an initial value
for (int i = 0; i < ptrs.length; ++i) {
if (!stripLastPtrConst || i < ptrs.length - 1)
result.append(asString(ptrs[i]));
else
result.append(asString(ptrs[i]).replaceAll("const", "")); //$NON-NLS-1$ //$NON-NLS-2$
}
}
private static void append(StringBuilder result, IASTNode node) {
// JI476551: When the code is parsed without full context, e.g., when parsing a Qt method ref, an
// ambiguous node could be created. Since we only need the original text, we can use
// any of the nodes that triggered the ambiguity. Arbitrarily choose the first one.
if (node instanceof ASTAmbiguousNode) {
IASTNode[] nodes = ((ASTAmbiguousNode) node).getNodes();
if (nodes != null && nodes.length > 0) {
append(result, nodes[0]);
return;
}
}
if (node instanceof ICPPASTTypeId) {
ICPPASTTypeId typeId = (ICPPASTTypeId) node;
IASTDeclSpecifier spec = typeId.getDeclSpecifier();
IASTDeclarator declarator = typeId.getAbstractDeclarator();
append(result, spec, declarator, false);
return;
}
if (!(node instanceof ICPPASTTemplateId)) {
result.append(node.toString());
return;
}
ICPPASTTemplateId templId = (ICPPASTTemplateId) node;
result.append(templId.getTemplateName());
result.append('<');
boolean first = true;
for (IASTNode child : templId.getTemplateArguments()) {
if (first)
first = false;
else
result.append(", "); //$NON-NLS-1$
append(result, child);
}
result.append('>');
}
}

View file

@ -1,118 +0,0 @@
/*******************************************************************************
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Doug Schaefer (QNX) - Initial implementation
*******************************************************************************/
package org.eclipse.cdt.internal.qt.core;
import java.util.Arrays;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.build.CBuilder;
import org.eclipse.cdt.core.dom.ILinkage;
import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.index.IIndexLinkage;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.internal.core.index.CIndex;
import org.eclipse.cdt.internal.core.index.IIndexFragment;
import org.eclipse.core.resources.ICommand;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IProjectNature;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
@SuppressWarnings("restriction")
public class QtNature implements IProjectNature {
public static final String ID = "org.eclipse.cdt.qt.core.qtNature"; //$NON-NLS-1$
private IProject project;
public static boolean hasNature(IProject project) {
try {
return project.hasNature(ID);
} catch (CoreException e) {
Activator.log(e);
return false;
}
}
public static void addNature(IProject project, IProgressMonitor monitor) throws CoreException {
if (project.isOpen()) {
if (hasNature(project))
return;
IProjectDescription desc = project.getDescription();
String[] oldIds = desc.getNatureIds();
String[] newIds = Arrays.copyOf(oldIds, oldIds.length + 1);
newIds[oldIds.length] = ID;
desc.setNatureIds(newIds);
project.setDescription(desc, monitor);
}
}
public static void setupBuilder(IProjectDescription projDesc) {
ICommand command = projDesc.newCommand();
CBuilder.setupBuilder(command);
projDesc.setBuildSpec(new ICommand[] { command });
}
@Override
public void configure() throws CoreException {
IProjectDescription projDesc = project.getDescription();
setupBuilder(projDesc);
project.setDescription(projDesc, new NullProgressMonitor());
}
// TODO no longer needed?
public void configurex() throws CoreException {
ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(project);
if (cProject == null)
return;
IIndex index = CCorePlugin.getIndexManager().getIndex(cProject);
if (!(index instanceof CIndex))
return;
// Don't reindex the project if it already has a Qt linkage. The index
// will be updated
// by the normal triggers.
for (IIndexFragment fragment : ((CIndex) index).getFragments())
for (IIndexLinkage linkage : fragment.getLinkages())
if (linkage.getLinkageID() == ILinkage.QT_LINKAGE_ID)
return;
// We need to force the index to be rebuilt the first time the Qt nature
// is added. If
// this doesn't happen then the PDOM could have the current version (so
// nothing would trigger
// an update) but no Qt content.
CCorePlugin.log(IStatus.INFO, "Reindexing " + project.getName() + " because Qt nature has been added"); //$NON-NLS-1$ //$NON-NLS-2$
CCorePlugin.getIndexManager().reindex(cProject);
}
@Override
public void deconfigure() throws CoreException {
// This space intentionally left blank.
}
@Override
public IProject getProject() {
return project;
}
@Override
public void setProject(IProject project) {
this.project = project;
}
}

View file

@ -1,67 +0,0 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.cdt.internal.qt.core;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.StringWriter;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
public class QtTemplateGenerator {
private final Configuration config;
public QtTemplateGenerator() throws CoreException {
config = new Configuration(Configuration.VERSION_2_3_22);
URL templateDirURL = FileLocator.find(Activator.getDefault().getBundle(), new Path("/templates"), null); //$NON-NLS-1$
try {
config.setDirectoryForTemplateLoading(new File(FileLocator.toFileURL(templateDirURL).toURI()));
} catch (IOException | URISyntaxException e) {
throw new CoreException(new Status(IStatus.ERROR, Activator.ID, "Template configuration", e));
}
}
public void generateFile(final Object model, String templateFile, final IFile outputFile, IProgressMonitor monitor)
throws CoreException {
try {
final Template template = config.getTemplate(templateFile);
try (StringWriter writer = new StringWriter()) {
template.process(model, writer);
try (ByteArrayInputStream in = new ByteArrayInputStream(
writer.getBuffer().toString().getBytes(StandardCharsets.UTF_8))) {
if (outputFile.exists()) {
outputFile.setContents(in, true, true, monitor);
} else {
outputFile.create(in, true, monitor);
}
}
}
} catch (IOException | TemplateException e) {
throw new CoreException(new Status(IStatus.ERROR, Activator.ID, "Processing template " + templateFile, e));
}
}
}

View file

@ -1,15 +0,0 @@
package org.eclipse.cdt.internal.qt.core.build;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.qt.core.build.messages"; //$NON-NLS-1$
public static String QtBuildConfigurationProvider_NoQtInstall;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
private Messages() {
}
}

View file

@ -1,503 +0,0 @@
/*******************************************************************************
* Copyright (c) 2015, 2022 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.cdt.internal.qt.core.build;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.ConsoleOutputStream;
import org.eclipse.cdt.core.ErrorParserManager;
import org.eclipse.cdt.core.IConsoleParser;
import org.eclipse.cdt.core.build.CBuildConfiguration;
import org.eclipse.cdt.core.build.IToolChain;
import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
import org.eclipse.cdt.core.model.ICModelMarker;
import org.eclipse.cdt.core.parser.ExtendedScannerInfo;
import org.eclipse.cdt.core.parser.IExtendedScannerInfo;
import org.eclipse.cdt.core.parser.IScannerInfo;
import org.eclipse.cdt.core.resources.IConsole;
import org.eclipse.cdt.internal.qt.core.Activator;
import org.eclipse.cdt.internal.qt.core.Messages;
import org.eclipse.cdt.internal.qt.core.QtInstallManager;
import org.eclipse.cdt.qt.core.IQtBuildConfiguration;
import org.eclipse.cdt.qt.core.IQtInstall;
import org.eclipse.cdt.qt.core.IQtInstallListener;
import org.eclipse.cdt.qt.core.IQtInstallManager;
import org.eclipse.cdt.qt.core.QtInstallEvent;
import org.eclipse.core.resources.IBuildConfiguration;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.osgi.service.prefs.BackingStoreException;
import org.osgi.service.prefs.Preferences;
public class QtBuildConfiguration extends CBuildConfiguration implements IQtBuildConfiguration, IQtInstallListener {
public static final String QMAKE_COMMAND = "cdt.qt.qmake.command"; //$NON-NLS-1$
public static final String QMAKE_ARGS = "cdt.qt.qmake.args"; //$NON-NLS-1$
public static final String BUILD_COMMAND = "cdt.qt.buildCommand"; //$NON-NLS-1$
private static final String QTINSTALL_NAME = "cdt.qt.install.name"; //$NON-NLS-1$
private static final String QTINSTALL_SPEC = "cdt.qt.install.spec"; //$NON-NLS-1$
private static final String LAUNCH_MODE = "cdt.qt.launchMode"; //$NON-NLS-1$
private final String qtInstallSpec;
private IQtInstall qtInstall;
private Map<String, String> qtProperties;
private boolean doFullBuild;
private IEnvironmentVariable pathVar = new IEnvironmentVariable() {
@Override
public String getValue() {
return getQmakeCommand().getParent().toString();
}
@Override
public int getOperation() {
return IEnvironmentVariable.ENVVAR_PREPEND;
}
@Override
public String getName() {
return "PATH"; //$NON-NLS-1$
}
@Override
public String getDelimiter() {
return File.pathSeparator;
}
};
public QtBuildConfiguration(IBuildConfiguration config, String name) throws CoreException {
super(config, name);
IQtInstallManager manager = Activator.getService(IQtInstallManager.class);
manager.addListener(this);
Preferences settings = getSettings();
String installName = settings.get(QTINSTALL_NAME, ""); //$NON-NLS-1$
qtInstallSpec = settings.get(QTINSTALL_SPEC, ""); //$NON-NLS-1$
if (!installName.isEmpty()) {
qtInstall = manager.getInstall(Paths.get(installName));
if (qtInstallSpec.isEmpty()) {
// save the spec if it wasn't set
settings.put(QTINSTALL_SPEC, qtInstall.getSpec());
try {
settings.flush();
} catch (BackingStoreException e) {
Activator.log(e);
}
}
}
if (getQtInstall() == null) {
throw new CoreException(new Status(IStatus.ERROR, Activator.ID, CCorePlugin.STATUS_BUILD_CONFIG_NOT_VALID,
String.format(Messages.QtBuildConfiguration_ConfigNotFound, name), null));
}
String oldLaunchMode = settings.get(LAUNCH_MODE, null);
if (oldLaunchMode != null) {
setLaunchMode(oldLaunchMode);
settings.remove(LAUNCH_MODE);
try {
settings.flush();
} catch (BackingStoreException e) {
Activator.log(e);
}
}
}
QtBuildConfiguration(IBuildConfiguration config, String name, IToolChain toolChain, IQtInstall qtInstall,
String launchMode) throws CoreException {
super(config, name, toolChain, launchMode);
this.qtInstall = qtInstall;
this.qtInstallSpec = qtInstall.getSpec();
IQtInstallManager manager = Activator.getService(IQtInstallManager.class);
manager.addListener(this);
Preferences settings = getSettings();
settings.put(QTINSTALL_NAME, qtInstall.getQmakePath().toString());
settings.put(QTINSTALL_SPEC, qtInstallSpec);
if (launchMode != null) {
settings.put(LAUNCH_MODE, launchMode);
}
try {
settings.flush();
} catch (BackingStoreException e) {
Activator.log(e);
}
}
@SuppressWarnings("unchecked")
@Override
public <T> T getAdapter(Class<T> adapter) {
if (adapter.equals(IQtBuildConfiguration.class)) {
return (T) this;
} else {
return super.getAdapter(adapter);
}
}
@Override
public IQtInstall getQtInstall() {
if (qtInstall == null && !qtInstallSpec.isEmpty()) {
// find one that matches the spec
IQtInstallManager manager = Activator.getService(IQtInstallManager.class);
Collection<IQtInstall> candidates = manager.getInstall(qtInstallSpec);
if (!candidates.isEmpty()) {
qtInstall = candidates.iterator().next();
}
}
return qtInstall;
}
@Override
public void installChanged(QtInstallEvent event) {
if (event.getType() == QtInstallEvent.REMOVED && event.getInstall().equals(qtInstall)) {
// clear the cache so we refetch later
qtInstall = null;
}
}
@Override
public Path getQmakeCommand() {
return getQtInstall().getQmakePath();
}
@Override
public String[] getQmakeConfig() {
String qmakeArgs = getProperty(QMAKE_ARGS);
if (qmakeArgs != null) {
return qmakeArgs.split(" "); //$NON-NLS-1$
}
String launchMode = getLaunchMode();
if (launchMode != null) {
switch (launchMode) {
case "run": //$NON-NLS-1$
return new String[] { "CONFIG-=debug_and_release", "CONFIG+=release" }; //$NON-NLS-1$ //$NON-NLS-2$
case "debug": //$NON-NLS-1$
return new String[] { "CONFIG-=debug_and_release", "CONFIG+=debug" }; //$NON-NLS-1$ //$NON-NLS-2$
default:
return new String[] { "CONFIG-=debug_and_release", "CONFIG+=launch_mode_" + launchMode }; //$NON-NLS-1$ //$NON-NLS-2$
}
}
return new String[] { "CONFIG+=debug_and_release", "CONFIG+=launch_modeall" }; //$NON-NLS-1$ //$NON-NLS-2$
}
public Path getProjectFile() {
File projectDir = getProject().getLocation().toFile();
File[] proFiles = projectDir.listFiles((dir, name) -> name.endsWith(".pro")); //$NON-NLS-1$
if (proFiles.length > 0) {
// TODO what if there are more than one.
return proFiles[0].toPath();
} else {
return null;
}
}
@Deprecated
@Override
public Path getProgramPath() throws CoreException {
// TODO get the app name from the .pro file.
String projectName = getProject().getName();
switch (Platform.getOS()) {
case Platform.OS_MACOSX:
Path appFolder = getBuildDirectory().resolve(projectName + ".app"); //$NON-NLS-1$
Path contentsFolder = appFolder.resolve("Contents"); //$NON-NLS-1$
Path macosFolder = contentsFolder.resolve("MacOS"); //$NON-NLS-1$
return macosFolder.resolve(projectName);
case Platform.OS_WIN32:
return getBuildDirectory().resolve(projectName + ".exe"); //$NON-NLS-1$
case Platform.OS_LINUX:
return getBuildDirectory().resolve(projectName);
default:
Path releaseFolder = getBuildDirectory().resolve("release"); //$NON-NLS-1$
return releaseFolder.resolve(projectName);
}
}
public String getQtProperty(String key) {
if (qtProperties == null) {
List<String> cmd = new ArrayList<>();
cmd.add(getQmakeCommand().toString());
cmd.add("-E"); //$NON-NLS-1$
String[] config = getQmakeConfig();
if (config != null) {
for (String str : config) {
cmd.add(str);
}
}
cmd.add(getProjectFile().toString());
try {
ProcessBuilder processBuilder = new ProcessBuilder(cmd)
.directory(getProjectFile().getParent().toFile());
setBuildEnvironment(processBuilder.environment());
Process proc = processBuilder.start();
try (BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream()))) {
qtProperties = new HashMap<>();
for (String line = reader.readLine(); line != null; line = reader.readLine()) {
int i = line.indexOf('=');
if (i >= 0) {
String k = line.substring(0, i);
String v = line.substring(i + 1);
qtProperties.put(k.trim(), v.trim());
}
}
}
} catch (IOException e) {
Activator.log(e);
}
}
return qtProperties != null ? qtProperties.get(key) : null;
}
@Override
public IEnvironmentVariable getVariable(String name) {
if ("PATH".equals(name)) { //$NON-NLS-1$
return pathVar;
} else {
return null;
}
}
@Override
public IEnvironmentVariable[] getVariables() {
return new IEnvironmentVariable[] { pathVar };
}
@Override
public IScannerInfo getScannerInformation(IResource resource) {
IQtInstall qtInstall = getQtInstall();
String cxx = getQtProperty("QMAKE_CXX"); //$NON-NLS-1$
if (cxx == null) {
Activator.log("No QMAKE_CXX for " + qtInstall.getSpec()); //$NON-NLS-1$
return null;
}
String[] cxxSplit = cxx.split(" "); //$NON-NLS-1$
Path command = Paths.get(cxxSplit[0]);
List<String> args = new ArrayList<>();
for (int i = 1; i < cxxSplit.length; ++i) {
args.add(cxxSplit[i]);
}
args.addAll(Arrays.asList(getQtProperty("QMAKE_CXXFLAGS").split(" "))); //$NON-NLS-1$ //$NON-NLS-2$
args.add("-o"); //$NON-NLS-1$
args.add("-"); //$NON-NLS-1$
String srcFile;
if (resource instanceof IFile) {
srcFile = resource.getLocation().toOSString();
// Only add file if it's an IFile
args.add(srcFile);
} else {
// Doesn't matter, the toolchain will create a tmp file for this
srcFile = "scannerInfo.cpp"; //$NON-NLS-1$
}
String[] includePaths = getQtProperty("INCLUDEPATH").split(" "); //$NON-NLS-1$ //$NON-NLS-2$
for (int i = 0; i < includePaths.length; ++i) {
Path path = Paths.get(includePaths[i]);
if (!path.isAbsolute()) {
Path projectDir = getProjectFile().getParent();
includePaths[i] = projectDir.resolve(path).toString();
}
}
IExtendedScannerInfo baseScannerInfo = new ExtendedScannerInfo(null, includePaths);
try {
return getToolChain().getScannerInfo(getBuildConfiguration(), command,
args.toArray(new String[args.size()]), baseScannerInfo, resource,
getBuildContainer().getLocationURI());
} catch (CoreException e) {
Activator.log(e);
return null;
}
}
@Override
public IProject[] build(int kind, Map<String, String> args, IConsole console, IProgressMonitor monitor)
throws CoreException {
IProject project = getProject();
try {
project.deleteMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_INFINITE);
ConsoleOutputStream errStream = console.getErrorStream();
ConsoleOutputStream outStream = console.getOutputStream();
String[] makeCommand = getMakeCommand();
if (makeCommand == null) {
errStream.write(Messages.QtBuildConfiguration_MakeNotFound);
return null;
}
Path buildDir = getBuildDirectory();
if (doFullBuild || !buildDir.resolve("Makefile").toFile().exists()) { //$NON-NLS-1$
// Need to run qmake
List<String> command = new ArrayList<>();
command.add(getQmakeCommand().toString());
String[] config = getQmakeConfig();
if (config != null) {
for (String str : config) {
command.add(str);
}
}
IFile projectFile = project.getFile(project.getName() + ".pro"); //$NON-NLS-1$
command.add(projectFile.getLocation().toOSString());
startBuildProcess(command, new IEnvironmentVariable[0],
new org.eclipse.core.runtime.Path(buildDir.toString()), console, monitor);
StringBuffer msg = new StringBuffer();
for (String arg : command) {
msg.append(arg).append(' ');
}
msg.append('\n');
outStream.write(msg.toString());
// TODO qmake error parser
watchProcess(console, monitor);
doFullBuild = false;
}
try (ErrorParserManager epm = new ErrorParserManager(project, getBuildDirectoryURI(), this,
getToolChain().getErrorParserIds())) {
epm.setOutputStream(console.getOutputStream());
// run make
List<String> command = new ArrayList<>(Arrays.asList(makeCommand));
command.add("all"); //$NON-NLS-1$
startBuildProcess(command, new IEnvironmentVariable[0],
new org.eclipse.core.runtime.Path(buildDir.toString()), console, monitor);
outStream.write(String.join(" ", command) + '\n'); //$NON-NLS-1$
watchProcess(new IConsoleParser[] { epm }, monitor);
}
getProject().refreshLocal(IResource.DEPTH_INFINITE, monitor);
return new IProject[] { project };
} catch (IOException e) {
throw new CoreException(new Status(IStatus.ERROR, Activator.ID, "Building " + project.getName(), e)); //$NON-NLS-1$
}
}
@Override
public void clean(IConsole console, IProgressMonitor monitor) throws CoreException {
IProject project = getProject();
try {
project.deleteMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_INFINITE);
ConsoleOutputStream errStream = console.getErrorStream();
ConsoleOutputStream outStream = console.getOutputStream();
String[] makeCommand = getMakeCommand();
if (makeCommand == null) {
errStream.write(Messages.QtBuildConfiguration_MakeNotFound);
return;
}
Path buildDir = getBuildDirectory();
try (ErrorParserManager epm = new ErrorParserManager(project, getBuildDirectoryURI(), this,
getToolChain().getErrorParserIds())) {
epm.setOutputStream(console.getOutputStream());
// run make
List<String> command = new ArrayList<>(Arrays.asList(makeCommand));
command.add("clean"); //$NON-NLS-1$
startBuildProcess(command, new IEnvironmentVariable[0],
new org.eclipse.core.runtime.Path(buildDir.toString()), console, monitor);
outStream.write(String.join(" ", command) + '\n'); //$NON-NLS-1$
watchProcess(new IConsoleParser[] { epm }, monitor);
}
project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
} catch (IOException e) {
throw new CoreException(new Status(IStatus.ERROR, Activator.ID, "Cleaning " + project.getName(), e)); //$NON-NLS-1$
}
}
public String[] getMakeCommand() {
String buildCommandStr = getProperty(BUILD_COMMAND);
if (buildCommandStr != null) {
String[] buildCommand = buildCommandStr.split(" "); //$NON-NLS-1$
Path command = findCommand(buildCommand[0]);
if (command == null) {
command = findCommand("make"); //$NON-NLS-1$
if (command == null) {
command = findCommand("mingw32-make"); //$NON-NLS-1$
}
}
if (command != null) {
buildCommand[0] = command.toString();
}
return buildCommand;
} else {
Path command = findCommand("make"); //$NON-NLS-1$
if (command == null) {
command = findCommand("mingw32-make"); //$NON-NLS-1$
}
if (command != null) {
return new String[] { command.toString() };
} else {
return null;
}
}
}
@Override
public boolean setProperties(Map<String, String> properties) {
if (super.setProperties(properties)) {
String qmakeCommand = properties.get(QMAKE_COMMAND);
if (qmakeCommand != null && !qmakeCommand.equals(qtInstall.getQmakePath().toString())) {
// TODO change the qtInstall
QtInstallManager installManager = Activator.getService(QtInstallManager.class);
IQtInstall newInstall = installManager.getInstall(Paths.get(qmakeCommand));
if (newInstall != null) {
qtInstall = newInstall;
}
}
// Do a full build to take in new properties
doFullBuild = true;
return true;
} else {
return false;
}
}
}

View file

@ -1,121 +0,0 @@
/*******************************************************************************
* Copyright (c) 2016 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.cdt.internal.qt.core.build;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.cdt.core.build.ICBuildConfiguration;
import org.eclipse.cdt.core.build.ICBuildConfigurationManager;
import org.eclipse.cdt.core.build.ICBuildConfigurationProvider;
import org.eclipse.cdt.core.build.IToolChain;
import org.eclipse.cdt.core.build.IToolChainManager;
import org.eclipse.cdt.internal.qt.core.Activator;
import org.eclipse.cdt.qt.core.IQtBuildConfiguration;
import org.eclipse.cdt.qt.core.IQtInstall;
import org.eclipse.cdt.qt.core.IQtInstallManager;
import org.eclipse.core.resources.IBuildConfiguration;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platform;
public class QtBuildConfigurationProvider implements ICBuildConfigurationProvider {
public static final String ID = "org.eclipse.cdt.qt.core.qtBuildConfigProvider"; //$NON-NLS-1$
private IToolChainManager toolChainManager = Activator.getService(IToolChainManager.class);
private IQtInstallManager qtInstallManager = Activator.getService(IQtInstallManager.class);
private ICBuildConfigurationManager configManager = Activator.getService(ICBuildConfigurationManager.class);
@Override
public String getId() {
return ID;
}
@Override
public ICBuildConfiguration getCBuildConfiguration(IBuildConfiguration config, String name) {
try {
if (config.getName().equals(IBuildConfiguration.DEFAULT_CONFIG_NAME)) {
// try the toolchain for the local target
Map<String, String> properties = new HashMap<>();
properties.put(IToolChain.ATTR_OS, Platform.getOS());
properties.put(IToolChain.ATTR_ARCH, Platform.getOSArch());
for (IToolChain toolChain : toolChainManager.getToolChainsMatching(properties)) {
for (IQtInstall qtInstall : qtInstallManager.getInstalls()) {
if (qtInstallManager.supports(qtInstall, toolChain)) {
return new QtBuildConfiguration(config, name, toolChain, qtInstall, null);
}
}
}
// local didn't work, try and find one that does
for (IToolChain toolChain : toolChainManager.getToolChainsMatching(new HashMap<>())) {
for (IQtInstall qtInstall : qtInstallManager.getInstalls()) {
if (qtInstallManager.supports(qtInstall, toolChain)) {
return new QtBuildConfiguration(config, name, toolChain, qtInstall, null);
}
}
}
// No valid combinations
return null;
} else {
return new QtBuildConfiguration(config, name);
}
} catch (CoreException e) {
// Failed to create the build config. Return null so it gets
// recreated.
Activator.log(e);
return null;
}
}
@Override
public ICBuildConfiguration createBuildConfiguration(IProject project, IToolChain toolChain, String launchMode,
IProgressMonitor monitor) throws CoreException {
IQtInstall qtInstall = getQtInstall(toolChain);
if (qtInstall != null) {
// See if one exists
for (IBuildConfiguration config : project.getBuildConfigs()) {
ICBuildConfiguration cconfig = config.getAdapter(ICBuildConfiguration.class);
if (cconfig != null) {
IQtBuildConfiguration qtConfig = cconfig.getAdapter(IQtBuildConfiguration.class);
if (qtConfig != null && launchMode.equals(qtConfig.getLaunchMode())
&& qtConfig.getToolChain().equals(toolChain)) {
return qtConfig;
}
}
}
// TODO what if multiple matches, this returns first match
String configName = "qt." + qtInstall.getSpec() + "." + launchMode; //$NON-NLS-1$ //$NON-NLS-2$
IBuildConfiguration config = configManager.createBuildConfiguration(this, project, configName, monitor);
QtBuildConfiguration qtConfig = new QtBuildConfiguration(config, configName, toolChain, qtInstall,
launchMode);
configManager.addBuildConfiguration(config, qtConfig);
return qtConfig;
} else {
return null;
}
}
private IQtInstall getQtInstall(IToolChain toolChain) {
for (IQtInstall qtInstall : qtInstallManager.getInstalls()) {
if (qtInstallManager.supports(qtInstall, toolChain)) {
return qtInstall;
}
}
return null;
}
}

View file

@ -1 +0,0 @@
QtBuildConfigurationProvider_NoQtInstall=No Qt install available for this target

View file

@ -1,32 +0,0 @@
/*
* Copyright (c) 2014 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.codan;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.qt.core.codan.messages"; //$NON-NLS-1$
public static String Function_Not_Resolved_Msg;
public static String Parameter_Not_Resolved_Msg;
public static String Missing_Parameter_Msg;
public static String SignalSlot_Not_Defined_Msg;
public static String QtConnect_macro_without_method_1;
public static String QtConnect_macro_method_not_found_3;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
private Messages() {
}
}

View file

@ -1,103 +0,0 @@
/*
* Copyright (c) 2014, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.codan;
import java.util.Collection;
import org.eclipse.cdt.codan.core.cxx.model.AbstractIndexAstChecker;
import org.eclipse.cdt.codan.core.model.CheckerLaunchMode;
import org.eclipse.cdt.codan.core.model.IProblemWorkingCopy;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.IASTExpression;
import org.eclipse.cdt.core.dom.ast.IASTFunctionCallExpression;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.internal.qt.core.ASTUtil;
import org.eclipse.cdt.internal.qt.core.Activator;
import org.eclipse.cdt.internal.qt.core.QtFunctionCall;
import org.eclipse.cdt.internal.qt.core.QtMethodReference;
import org.eclipse.cdt.internal.qt.core.QtNature;
import org.eclipse.cdt.internal.qt.core.index.IQMethod;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.osgi.util.NLS;
/**
* A Codan checker for QObject::connect and QObject::disconnect function calls. The checker
* confirms that SIGNAL and SLOT macro expansions reference a valid Qt signal or slot.
*/
public class QtSyntaxChecker extends AbstractIndexAstChecker {
private final Checker checker = new Checker();
@Override
public boolean runInEditor() {
return true;
}
@Override
public void initPreferences(IProblemWorkingCopy problem) {
// don't run on full or incremental builds
getTopLevelPreference(problem);
getLaunchModePreference(problem).enableInLaunchModes(CheckerLaunchMode.RUN_ON_FILE_OPEN,
CheckerLaunchMode.RUN_AS_YOU_TYPE, CheckerLaunchMode.RUN_ON_DEMAND);
}
@Override
public synchronized boolean processResource(IResource resource) throws OperationCanceledException {
if (QtNature.hasNature(resource.getProject()))
return super.processResource(resource);
return false;
}
@Override
public void processAst(IASTTranslationUnit ast) {
// Run the checker only on Qt-enabled projects.
if (QtNature.hasNature(ASTUtil.getProject(ast)))
ast.accept(checker);
}
private class Checker extends ASTVisitor {
public Checker() {
shouldVisitExpressions = true;
}
@Override
public int visit(IASTExpression expr) {
if (!(expr instanceof IASTFunctionCallExpression))
return PROCESS_CONTINUE;
IASTFunctionCallExpression fncall = (IASTFunctionCallExpression) expr;
Collection<QtMethodReference> refs = QtFunctionCall.getReferences(fncall);
if (refs != null)
for (QtMethodReference ref : refs) {
IQMethod method = ref.getMethod();
if (method != null)
continue;
// Either the macro expansion didn't have an argument, or the argument was not a valid method.
if (ref.getRawSignature().isEmpty())
report(ref, Messages.QtConnect_macro_without_method_1, ref.getType().macroName);
else
report(ref, Messages.QtConnect_macro_method_not_found_3, ref.getType().paramName,
ref.getContainingType().getName(), ref.getRawSignature());
}
return PROCESS_CONTINUE;
}
private void report(IASTNode node, String message, Object... args) {
if (args.length <= 0)
reportProblem(Activator.QT_SYNTAX_ERR_ID, node, message);
else
reportProblem(Activator.QT_SYNTAX_ERR_ID, node, NLS.bind(message, args));
}
}
}

View file

@ -1,16 +0,0 @@
# Copyright (c) 2014 QNX Software Systems and others.
#
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
Function_Not_Resolved_Msg=Function "{0}" can not be resolved
Parameter_Not_Resolved_Msg="{0}" is not a valid parameter
Missing_Parameter_Msg=Missing parameter
SignalSlot_Not_Defined_Msg=Signal/Slot "{0}" is not defined
QtConnect_macro_without_method_1 = The {0} parameter does not specify a method
QtConnect_macro_method_not_found_3 = {1}::{2} has not been tagged as a Qt {0}; make sure all parameter types are fully qualified

View file

@ -1,40 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
import org.eclipse.cdt.internal.qt.core.index.IQObject.IMember;
public abstract class AbstractQField implements IQObject.IMember {
private final IQObject owner;
protected String name;
protected AbstractQField(IQObject owner) {
this.owner = owner;
}
@Override
public IQObject getOwner() {
return owner;
}
@Override
public boolean isOverride(IMember member) {
if (!AbstractQField.class.isAssignableFrom(member.getClass()))
return false;
// I haven't been able to find Qt documentation describing how things like
// Q_PROPERY are overridden, but the docs suggest it is just by name.
AbstractQField other = (AbstractQField) member;
return name == null ? other.name == null : name.equals(other.name);
}
}

View file

@ -1,65 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.internal.qt.core.Activator;
import org.eclipse.core.runtime.CoreException;
/**
* A wrapper around the CDT index that manages the read lock.
*/
public class CDTIndex {
private final IIndex index;
public CDTIndex(IIndex index) {
this.index = index;
}
/**
* An object used for reading from the CDT index. The {@link #access(IIndex)} method
* will only be invoked when the index's read lock has been properly acquired.
*/
public static interface Accessor<T> {
/**
* A method that performs the lookup within the CDT index. The read-lock will
* be acquired before invoking this method.
* <p>
* <strong>The implementation of access must not make calls to {@link CDTIndex#get(Accessor)}.
* If other objects are needed, then have the accessor return a qualified name and
* lookup the object after the implementation of #access completes.</strong>
*/
public T access(IIndex index) throws CoreException;
}
/**
* Use the given accessor to find and return a value from the index. This method ensures
* that the read-lock has been acquired.
*/
public <T> T get(Accessor<T> accessor) {
try {
index.acquireReadLock();
} catch (InterruptedException e) {
return null;
}
try {
return accessor.access(index);
} catch (CoreException e) {
Activator.log(e);
} finally {
index.releaseReadLock();
}
return null;
}
}

View file

@ -1,23 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
import org.eclipse.cdt.core.dom.ast.IBinding;
/**
* Base interface for things that are accessed from the {@link QtIndex}.
*/
public interface IQElement {
/**
* Returns the IBinding from the CDT index for the receiver element.
*/
public IBinding getBinding();
}

View file

@ -1,82 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
import java.util.Collection;
/**
* Represents expansions of the Q_ENUMS macro within a class declaration.
* <pre>
* class B : public QObject
* {
* Q_OBJECT
* enum E { enumerator };
* Q_ENUMS( E )
* };
*
* class Q : public QObject
* {
* Q_OBJECT
* Q_ENUMS( B::E E0 )
* Q_ENUMS( E1 )
* enum E0 { e0a, e0b = 2 };
* enum E1 { e1 };
* }
* </pre>
* NOTE: http://qt-project.org/doc/qt-4.8/qobject.html#Q_ENUMS
* <blockquote>
* If you want to register an enum that is declared in another class, the enum must be fully qualified
* with the name of the class defining it. In addition, the class defining the enum has to inherit
* QObject as well as declare the enum using Q_ENUMS().
* </blockquote>
* So, the lookup for the C++ enum only needs to look in the same class spec when the name is not
* qualified. When it is qualified, then it needs to find the QObject and then look at its Q_ENUMS.
*/
public interface IQEnum {
/**
* Returns the name of the enumerator as referenced in parameter in the Q_ENUMS
* macro expansion. In the sample code in the class declaration, this would return
* "B::E", "E0", or "E1".
*/
public String getName();
/**
* Returns true if this enumeration was introduced to the Qt meta-object system with
* a Q_FLAGS expansion and false if it was introduced with Q_ENUMS.
*/
public boolean isFlag();
/**
* Returns an unsorted collection of the enumerators contained in the enum references
* in the Q_ENUMS macro expansion.
* <p>
* NOTE: It would be nice if the textual order of the enumerators was preserved by the
* underlying CDT index, but it is not. The {@link Enumerator#getOrdinal()} method can
* be used to recover some ordering information.
*/
public Collection<Enumerator> getEnumerators();
/**
* A small wrapper class for the enumerators that are declared within the enum that is
* referenced by the parameter of the Q_ENUMS macro expansion.
*/
public interface Enumerator {
/**
* Returns the name of the enumerator.
*/
public String getName();
/**
* Returns the ordinal (either explicitly or implicitly) assigned to the enumerator.
*/
public Long getOrdinal();
}
}

View file

@ -1,32 +0,0 @@
/*
* Copyright (c) 2014, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
import java.util.Collection;
/**
* Represents classes that have been tagged as Q_GADGETs. Q_GADGETs are normal
* C++ class declarations that have been tagged with the Q_GADGET macro and are
* therefore able to add enums and flags to the Qt meta-object system.
*/
public interface IQGadget {
/**
* Returns the name of the class.
*/
public String getName();
/**
* Returns an unsorted collection of all Q_ENUMS macro expansions within this QObject's class
* declaration.
* @see IQEnum
*/
public Collection<IQEnum> getEnums();
}

View file

@ -1,37 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
/**
* Represents a QMake environment. It is usually created by IQMakeEnvProvider.createEnv() method for a specific project configuration.
*
* Note that IQMakeEnv has destroy method only and it is expected that the instance is already initialized in the constructor.
* This means that it may happen that IQMakeEnv instance is created and destroyed immediately.
*
* See IQMakeEnv2 interface if you want to get an explicit notification when IQMakeEnv gets really used. In that case, the instance initialization
* needs to be done in init method completely - not in the constructor.
*/
public interface IQMakeEnv {
/**
* Notifies that this environment is no longer used.
* This method should not use any workspace-lock or sync-locks that might call QMake-related structures.
*/
void destroy();
/**
* Returns an actual QMake environment information that is used for a single qmake run to retrieve QMake information.
*
* @return the actual QMake environment information
*/
QMakeEnvInfo getQMakeEnvInfo();
}

View file

@ -1,29 +0,0 @@
/*
* Copyright (c) 2014, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
/**
* Represents a QMake environment similarly to IQMakeEnv but it has an explicit init method which is called to notify
* that the IQMakeEnv is used for active listening on change of QMakeEnvInfo and therefore it should initialize
* its listener for such changes.
*
* Note that it is expected that IQMakeEnv2 does complete initialization in init method - not in the constructor
* i.e. the IQMakeEnv2 instance should start listening on possible changes of its IQMakeEnvInfo.
*/
public interface IQMakeEnv2 extends IQMakeEnv {
/**
* Notifies that this IQMakeEnv is used.
* This method should not use any workspace-lock or sync-locks that might call QMake-related structures.
*/
void init();
}

View file

@ -1,54 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
/**
* Represents a provider for IQMakeEnv which is used to specify an environment for qmake run.
* This class needs to be registered via org.eclipse.cdt.qt.core.qmakeEnvProvider extension point.
*/
public interface IQMakeEnvProvider {
/**
* Creates a QMake environment for a specific IController (aka a project configuration).
*
* @param controller the controller
* @return the IQMakeEnv instance that is used for qmake run;
* or null if this provider cannot create IQMakeEnv instance for the specified IController.
*/
IQMakeEnv createEnv(IController controller);
/**
* Represents a project configuration and provides a control over the environment.
*
* This class is not meant to be implemented.
*/
public interface IController {
/**
* Returns a project configuration for which a QMake environment should be supplied.
*
* @return the project configuration
*/
ICConfigurationDescription getConfiguration();
/**
* Request the controller to schedule a new qmake run to retrieve new QMake information.
* This method should be called when there is any change in IQMakeEnv that might affect resulting IQMakeEnvInfo.
*
* Note that calculation of new QMakeInfo is done immediately if this controller is still active and used.
*/
void scheduleUpdate();
}
}

View file

@ -1,124 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
import java.util.List;
import java.util.Map;
/**
* Represents a QMake information.
*
* Note that current implementation of does not handle support QMake 2.0 in full range so provided information might be incomplete.
*
* This class is not meant to be implemented.
*/
public interface IQMakeInfo {
/**
* Returns whether this information is valid. If invalid, then returned value of the other method is unspecified.
*
* @return true if this information is valid
*/
boolean isValid();
/**
* Returns a map of key-value pairs provided by "qmake -query" command.
*
* @return the map
*/
Map<String, String> getQMakeQueryMap();
/**
* Returns a Qt version as provided by "qmake -query" command.
*
* @return the Qt version
*/
IQtVersion getQtVersion();
/**
* Returns a list of QMake files (.pro, .pri, .prf, ...) that are involved in resolving this information as retrieved
* via "qmake -E file.pro" command.
*
* @return the list of involved QMake files
*/
List<String> getInvolvedQMakeFiles();
/**
* Returns a list of Qt Import paths. Represents QT_IMPORT_PATH that is used by QDeclarativeEngine (aka QtQuick1) runtime to load QML modules.
*
* @return the list of Qt Import paths
*/
List<String> getQtImportPath();
/**
* Returns a list of Qt Qml paths that is used by QQmlEngine (aka QtQuick2) runtime to load QML modules.
*
* @return the list of Qt Qml paths
*/
List<String> getQtQmlPath();
/**
* Returns a list of Qt Documentation paths.
*
* @return the list of Qt Documentation paths
*/
List<String> getQtDocPath();
/**
* Returns a list of include paths that are used for compilation of a related project.
*
* @return the list of include paths
*/
List<String> getIncludePath();
/**
* Returns a list of defines that are used for compilation of a related project i.e. specified via DEFINES QMake variable.
*
* @return the list of defines.
*/
List<String> getDefines();
/**
* Returns a list of source file paths i.e. specified via SOURCES QMake variable.
*
* @return the list of source file paths
*/
List<String> getSourceFiles();
/**
* Returns a list of header file paths i.e. specified via HEADERS QMake variable.
*
* @return the list of header file paths
*/
List<String> getHeaderFiles();
/**
* Returns a list of resource file paths i.e. specified via RESOURCES QMake variable.
*
* @return the list of other file paths
*/
List<String> getResourceFiles();
/**
* Returns a list of other file paths i.e. specified via FORMS QMake variable.
*
* @return the list of other file paths
*/
List<String> getFormFiles();
/**
* Returns a list of other file paths i.e. specified via OTHER_FILES QMake variable.
*
* @return the list of other file paths
*/
List<String> getOtherFiles();
}

View file

@ -1,50 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
/**
* Represents provider of QMake information.
*
* This class is not meant to be implemented.
*/
public interface IQMakeProjectInfo {
/**
* Add a listener that notifies about possible changes of IQMakeInfo retrieved from getActualInfo() method.
*
* @param listener the listener
*/
void addListener(IQMakeProjectInfoListener listener);
/**
* Removes a listener that was added via addListener() method.
*
* @param listener the listener
*/
void removeListener(IQMakeProjectInfoListener listener);
/**
* Returns an actual QMake information.
*
* @return non-null IQMakeInfo instance representing the actual QMake information
*/
IQMakeInfo getActualInfo();
/**
* Updates the actual QMake information and returns it.
*
* Note that this is a long-term operation and the method call is blocked until an actual QMake information is calculated.
*
* @return non-null IQMakeInfo instance representing the actual QMake information calculated at the time of this method call.
*/
IQMakeInfo updateActualInfo();
}

View file

@ -1,28 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
/**
* A listener used for notifying that a QMake information provided by IQMakeProjectInfo might have changed.
*/
public interface IQMakeProjectInfoListener {
/**
* Notifies that a QMake information provided by IQMakeProjectInfo might have changed.
* A new QMake information can be read via IQMakeProjectInfo.getQMakeInfo() method.
*
* Note that this method might be called even after the listener is removed from
* IQMakeProjectInfo. To prevent this, your implementation should maintain a flag
* representing whether qmakeInfoChanged() notifications should be processed or not.
*/
void qmakeInfoChanged();
}

View file

@ -1,69 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
import java.util.Collection;
/**
* Qt provides macros for marking member functions as special. The moc compiler
* recognizes these annotations and generates extra code to implement the special
* behaviour.
*
* This interface is used to represent these methods in the Qt index. It is used
* for member functions that have been marked as signals, slots, and invokables.
*/
public interface IQMethod extends IQElement, IQObject.IMember {
/**
* The kind of Qt annotation that has been applied to this member function.
* Signals and slots are implicitly invokable, if a single member function
* has been tagged with both signal/slot and invokable, the kind will be
* Signal or Slot.
*/
public static enum Kind {
Unspecified, Invokable, Signal, Slot;
}
/**
* The kind of Qt annotation that has been applied to this member function. Signals and
* slots are implicitly invokable, if a single member function has been tagged with both
* signal and invokable, the kind will be Signal (and likewise for Slot).
*/
public Kind getKind();
/**
* Returns the function name of the method.
*/
public String getName();
/**
* Returns the normalized C++ function signatures of the receiver method. There is
* more than one signature only when at least one parameter has a default value.
* E.g., for
* #signal1 in:
* <pre>
* class T : public QObject
* {
* Q_OBJECT
* Q_SIGNAL void signal1( int = 5 );
* };
* </pre>
* This would return "{ signal1(int), signal1() }".
*/
public Collection<String> getSignatures();
/**
* Return the revision if this method was tagged with the Q_REVISION macro and null
* otherwise. The return type is Long in order to accommodate unsigned C++ 32-bit
* values.
*/
public Long getRevision();
}

View file

@ -1,129 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
import java.util.Collection;
import java.util.List;
/**
* A class that inherits the Qt QObject and contains an expansion of Q_OBJECT. This
* provides a handle for retrieving signals, slots, and other Qt-related elements.
* @see IQMethod
*/
public interface IQObject extends IQElement {
/**
* The interface to be implemented by elements that can be returned as members of an
* implementation of {@link IQObject}.
*/
public static interface IMember {
/**
* Return the QObject class that declares this member. Does not return null.
*/
public IQObject getOwner();
/**
* Returns true if it is <strong>*possible*</strong> for this member and the parameter
* to override each the other. A true result indicates that <strong>*if*</strong> the members
* owner's are related by inheritance then one will override the other; the implementation
* does not check that there actually is such an inheritance relationship.
*/
public boolean isOverride(IMember member);
}
/**
* A wrapper for unmodifiable collections of members of a class. Accessors provide filtered
* views of the member list.
*
* @see #all()
* @see #locals()
* @see #withoutOverrides()
*/
public static interface IMembers<T extends IMember> {
/**
* Returns an unmodifiable collection with all locally declared, inherited, and overridden
* members. Does not return null.
*/
public Collection<T> all();
/**
* Returns an unmodifiable collection with only the members that are locally declared in the
* source class. Does not return null.
*/
public Collection<T> locals();
/**
* Returns an unmodifiable collection of all locally declared and inherited members with the
* overridden members filtered out. Does not return null.
*/
public Collection<T> withoutOverrides();
}
/**
* Returns the fully qualified name of the class.
*/
public String getName();
/**
* Returns a list of the QObject's that are bases of this class.
* E.g. in:
* <pre>
* class T {};
* class B1 : public QObject { Q_OBJECT };
* class B2 : public QObject { Q_OBJECT };
* class B3 : public T, public QObject { };
* class D : public B1, public B2, public B3, public T { Q_OBJECT };
* </pre>
* The list of bases for D will contain B1 and B2, but not B3 or T.
* <p>
* The list will be ordered as in the C++ code and will include only the directly declared
* base classes.
*/
public List<IQObject> getBases();
/**
* Returns the methods that have been tagged as Qt slots. Does not return null.
*/
public IMembers<IQMethod> getSlots();
/**
* Returns the methods that have been tagged as Qt signals. Does not return null.
*/
public IMembers<IQMethod> getSignals();
/**
* Returns the methods that have been tagged with Q_INVOKABLE. Does not return null.
*/
public IMembers<IQMethod> getInvokables();
/**
* Returns the expansions of the Q_PROPERTY macro. Does not return null.
*/
public IMembers<IQProperty> getProperties();
/**
* Returns the methods that have been tagged with Q_INVOKABLE. Does not return null.
*/
public Collection<IQmlRegistration> getQmlRegistrations();
/**
* Examines the Q_CLASSINFO expansions to return the value associated with the given
* key. Returns null if there isn't a Q_CLASSINFO for the given key.
*/
public String getClassInfo(String key);
/**
* Returns an unsorted collection of all Q_ENUMS macro expansions within this QObject's class
* declaration.
* @see IQEnum
*/
public Collection<IQEnum> getEnums();
}

View file

@ -1,165 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
/**
* A container for things declared as Q_PROPERTY within a subclass of QObject. In Qt 4.8,
* Q_PROPERTY looks like:
* <pre>
* Q_PROPERTY( type name
* READ getFunction
* [WRITE setFunction]
* [RESET resetFunction]
* [NOTIFY notifySignal]
* [REVISION int]
* [DESIGNABLE bool]
* [SCRIPTABLE bool]
* [STORED bool]
* [USER bool]
* [CONSTANT]
* [FINAL] )
* </pre>
* This interface provides structured access to the elements of the Q_PROPERTY expansion.
*/
public interface IQProperty extends IQObject.IMember {
/**
* The attributes that were defined in Qt 4.8. This is the full set of attributes
* that will be parsed from Q_PROPERTY expansions.
*/
public static enum Attribute {
// This enum is used when scanning Q_PROPERTY expansions, only attributes listed here
// will be extracted from the expansion. This enum should be expanded with new values
// as needed (based on the version of Qt). See QProperty#scanAttributes.
READ("getFunction"), //$NON-NLS-1$
WRITE("setFunction"), //$NON-NLS-1$
RESET("resetFunction"), //$NON-NLS-1$
NOTIFY("notifySignal"), //$NON-NLS-1$
REVISION("int"), //$NON-NLS-1$
DESIGNABLE("bool"), //$NON-NLS-1$
SCRIPTABLE("bool"), //$NON-NLS-1$
STORED("bool"), //$NON-NLS-1$
USER("bool"), //$NON-NLS-1$
CONSTANT(null), FINAL(null);
/**
* A string containing the C++ identifier for this attribute.
*/
public final String identifier = toString();
/**
* Stores the attribute parameter name if it exists and null for attributes
* without parameters. The parameter name comes from the Qt documentation
* and is only intended for documentation.
*/
public final String paramName;
/**
* True when this attribute is expected to have a value and false otherwise.
*/
public final boolean hasValue;
private Attribute(String paramName) {
this.paramName = paramName;
this.hasValue = paramName != null;
}
/**
* A convenience method to access the value of a property through this
* enum, e.g.,
* <pre>
* IQProperty qprop;
* String readFunction = IQProperty.Attribute.READ.valueId( qprop );
* </pre>
* Returns null if there is no associated value in the given property.
*/
public String valueIn(IQProperty qprop) {
return qprop == null ? null : qprop.getValue(this);
}
}
/**
* Returns the type of the property. This is the first field in the Q_PROPERTY expansion.
*/
public String getType();
/**
* Returns the name of the property. This is the second field in the Q_PROPERTY expansion.
*/
public String getName();
/**
* Return the value of the attribute associated with the given key. E.g., in
* <pre>
* Q_PROPERTY( bool allowed READ isAllowed )
* <pre>
* The parameter Attribute.READ would return "isAllowed".
*
* Returns null if the given key is not described in the property.
*/
public String getValue(Attribute attr);
/**
* Return the value of READ or null if READ is not described in the property.
*/
public String getReadMethodName();
/**
* Return the value of WRITE or null if WRITE is not described in the property.
*/
public String getWriteMethodName();
/**
* Return the value of RESET or null if RESET is not described in the property.
*/
public String getResetMethodName();
/**
* Return the value of NOTIFY or null if NOTIFY is not described in the property.
*/
public String getNotifyMethodName();
/**
* Return the value of REVISION or null if REVISION is not described in the property.
* The return type is Long in order to accommodate unsigned C++ 32-bit values.
*/
public Long getRevision();
/**
* Return the value of DESIGNABLE or null if DESIGNABLE is not described in the property.
*/
public String getDesignable();
/**
* Return the value of SCRIPTABLE or null if SCRIPTABLE is not described in the property.
*/
public String getScriptable();
/**
* Return the value of STORED or null if STORED is not described in the property.
*/
public String getStored();
/**
* Return the value of USER or null if USER is not described in the property.
*/
public String getUser();
/**
* Return true if CONSTANT was specified in the Q_PROPERTY expansion and false otherwise.
*/
public boolean isConstant();
/**
* Return true if FINAL was specified in the Q_PROPERTY expansion and false otherwise.
*/
public boolean isFinal();
}

View file

@ -1,116 +0,0 @@
/*
* Copyright (c) 2014, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
/**
* Represents a specific QML type registration.
* <p>
* Qt allows types to be registered with QML by calling the qmlRegisterType function,
* e.g.,
* <pre>
* class Q : public QObject { Q_OBJECT };
* qmlRegisterType&lt;Q&gt;( "uri", 1, 0, "Q" );
* </pre>
* Registers Q in the QML system with the name "Q", in the library imported from "uri"
* having the version number 1.0.
*/
public interface IQmlRegistration extends IQObject.IMember {
/**
* Identifies the kind of qmlRegister* function that was used to register the
* type. Qt 4.8 only defines two kinds, but in 5.0 there several more.
* <p>
* If a type has been registered more than once, then there will be several
* entries for it in the collection returned by {@link QtIndex#getQmlRegistrations()}.
*/
public enum Kind {
/**
* Indicates that the type has been registered with a function call to
* qmlRegisterType.
*/
Type,
/**
* Indicates that the type has been registered with a function call to
* qmlRegisterUncreatableType.
*/
Uncreatable
}
/**
* Returns the kind of function that was used for this registration. In Qt 4.8,
* there are two variations of the qmlRegister* function; qmlRegisterType and
* qmlRegisterUncreatableType. In Qt 5.0 there are several more.
* <p>
* It is possible for the same type to be registered in different ways, although
* this generally indicates a problem in the client code.
*/
public IQmlRegistration.Kind getKind();
/**
* Returns QObject to which this registration applies. In the sample at {@link IQmlRegistration}
* this would return the IQObject for Q.
*/
public IQObject getQObject();
/**
* Returns the specific revision of the IQObject that was registered. Returns null if no
* revision was specified.
* <p>
* E.g.,
* <code>
* class Q : public QObject
* {
* Q_OBJECT
* signals:
* Q_REVISION(2) void sig();
* };
*
* qmlRegisterType<Q>( "uri", 1, 0, "Q1" );
* qmlRegisterType<Q, 2>( "uri", 1, 0, "Q2" );
* </code>
*
* The QML type "Q2" would have access to the "sig" signal, while "Q1" would not.
*
* @see IQMethod#getRevision()
* @see IQProperty#getRevision()
*/
public Long getVersion();
/**
* Returns the literal value of the first argument to the function if it can be
* resolved and null otherwise.
*/
public String getURI();
/**
* Returns the literal value of the second argument to the function if it can be
* resolved and null otherwise.
*/
public Long getMajor();
/**
* Returns the literal value of the third argument to the function if it can be
* resolved and null otherwise.
*/
public Long getMinor();
/**
* Returns the literal value of the fourth argument to the function if it can be
* resolved and null otherwise.
*/
public String getQmlName();
/**
* Returns the literal value of the fifth argument to qmlRegisterUncreatableType if it
* can be resolved and null otherwise.
*/
public String getReason();
}

View file

@ -1,30 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
/**
* Represents a Qt version in form of major and minor number.
*/
public interface IQtVersion {
/**
* Returns major version number.
* @return the major version number
*/
int getMajor();
/**
* Returns minor version number.
* @return the minor version number
*/
int getMinor();
}

View file

@ -1,71 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.eclipse.cdt.core.dom.ast.IEnumerator;
import org.eclipse.cdt.core.dom.ast.IValue;
public class QEnum implements IQEnum {
private final String name;
private final boolean isFlag;
private final List<IQEnum.Enumerator> enumerators;
public QEnum(String name, boolean isFlag, List<IEnumerator> enumerators) {
this.name = name;
this.isFlag = isFlag;
this.enumerators = new ArrayList<>(enumerators.size());
for (IEnumerator enumerator : enumerators)
this.enumerators.add(new Enumerator(enumerator));
}
@Override
public String getName() {
return name;
}
@Override
public boolean isFlag() {
return isFlag;
}
@Override
public Collection<IQEnum.Enumerator> getEnumerators() {
return enumerators;
}
private static class Enumerator implements IQEnum.Enumerator {
private final String name;
private final Long ordinal;
public Enumerator(IEnumerator enumerator) {
this.name = enumerator.getName();
IValue val = enumerator.getValue();
this.ordinal = val == null ? null : val.numberValue().longValue();
}
@Override
public String getName() {
return name;
}
@Override
public Long getOrdinal() {
return ordinal;
}
}
}

View file

@ -1,43 +0,0 @@
/*
* Copyright (c) 2014, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.eclipse.cdt.internal.qt.core.pdom.AbstractQtPDOMClass;
import org.eclipse.cdt.internal.qt.core.pdom.QtPDOMQEnum;
import org.eclipse.core.runtime.CoreException;
public class QGadget implements IQGadget {
private final String name;
private final List<IQEnum> enums;
public QGadget(QtIndexImpl qtIndex, CDTIndex cdtIndex, AbstractQtPDOMClass pdomQGadget) throws CoreException {
this.name = pdomQGadget.getName();
this.enums = new ArrayList<>();
for (QtPDOMQEnum pdom : pdomQGadget.getChildren(QtPDOMQEnum.class))
this.enums.add(new QEnum(pdom.getName(), pdom.isFlag(), pdom.getEnumerators()));
}
@Override
public String getName() {
return name;
}
@Override
public Collection<IQEnum> getEnums() {
return enums;
}
}

View file

@ -1,85 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IFile;
/**
* Holds data describing QMake environment (pro file, qmake file, env. vars.) for a specific QMake run provided by QMakeEnv instance.
*/
public final class QMakeEnvInfo {
private final IFile proFile;
private final String qmakeFilePath;
private final Map<String, String> environment;
private final Set<IFile> sensitiveFiles;
/**
* Creates QMakeEnvInfo.
*
* @param proFile the root-level .pro file
* @param qmakeFilePath the absolute path of qmake executable
* @param environment environment variables
* @param sensitiveFiles the list of IFile that needs to be tracked by IQMakeProjectInfo since their change might affect
* an environment for running qmake.
*/
public QMakeEnvInfo(IFile proFile, String qmakeFilePath, Map<String, String> environment,
Collection<IFile> sensitiveFiles) {
this.proFile = proFile;
this.qmakeFilePath = qmakeFilePath;
this.environment = environment != null ? new HashMap<>(environment) : Collections.<String, String>emptyMap();
this.sensitiveFiles = sensitiveFiles != null ? new HashSet<>(sensitiveFiles) : Collections.<IFile>emptySet();
}
/**
* Returns IFile of .pro file.
*
* @return the .pro file
*/
public IFile getProFile() {
return proFile;
}
/**
* Returns an absolute path of qmake executable.
*
* @return the qmake path
*/
public String getQMakeFilePath() {
return qmakeFilePath;
}
/**
* Returns a map of environment variables that are used for qmake run.
*
* @return the environment
*/
public Map<String, String> getEnvironment() {
return environment;
}
/**
* Returns a list of IFile that might affect environment of qmake run.
*
* @return the list sensitive files
*/
public Set<IFile> getSensitiveFiles() {
return sensitiveFiles;
}
}

View file

@ -1,140 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicReference;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.internal.qt.core.Activator;
import org.eclipse.cdt.internal.qt.core.index.IQMakeEnvProvider.IController;
import org.eclipse.core.expressions.EvaluationContext;
import org.eclipse.core.expressions.EvaluationResult;
import org.eclipse.core.expressions.Expression;
import org.eclipse.core.expressions.ExpressionConverter;
import org.eclipse.core.expressions.ExpressionTagNames;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
/**
* Represents a IQMakeEnvProvider that is registered via qmakeEnvProvider extension point.
*/
public final class QMakeEnvProviderDescriptor implements Comparable<QMakeEnvProviderDescriptor> {
private static final String ATTR_CLASS = "class"; //$NON-NLS-1$
private static final String ATTR_PRIORITY = "priority"; //$NON-NLS-1$
private static final String VAR_PROJECTNATURES = "projectNatures"; //$NON-NLS-1$
private final IConfigurationElement element;
private final String id;
private final int priority;
private final AtomicReference<Boolean> evaluation = new AtomicReference<>();
private final Expression enablementExpression;
QMakeEnvProviderDescriptor(IConfigurationElement element) {
this.element = element;
id = element.getContributor().getName();
// parse priority
int prio = 0;
String priorityString = element.getAttribute(ATTR_PRIORITY);
if (priorityString != null) {
try {
prio = Integer.parseInt(priorityString);
} catch (NumberFormatException e) {
Activator.log("Invalid priority value of " + id, e); //$NON-NLS-1$
}
}
this.priority = prio;
// parse enablement expression
Expression expr = null;
IConfigurationElement[] children = element.getChildren(ExpressionTagNames.ENABLEMENT);
switch (children.length) {
case 0:
evaluation.set(Boolean.TRUE);
break;
case 1:
try {
ExpressionConverter parser = ExpressionConverter.getDefault();
expr = parser.perform(children[0]);
} catch (CoreException e) {
Activator.log("Error in enablement expression of " + id, e); //$NON-NLS-1$
}
break;
default:
Activator.log("Too many enablement expressions for " + id); //$NON-NLS-1$
evaluation.set(Boolean.FALSE);
break;
}
enablementExpression = expr;
}
@Override
public int compareTo(QMakeEnvProviderDescriptor that) {
if (that == null) {
return -1;
}
return this.priority - that.priority;
}
/**
* Used by QMakeEnvProviderManager to ask for creating a IQMakeEnv for a specific IQMakeEnvProvider.IController using the related IQMakeEnvProvider
*
* @param controller the controller
* @return the IQMakeEnv instance; or null if no instance is provided
*/
public IQMakeEnv createEnv(IController controller) {
if (!matches(controller)) {
return null;
}
IQMakeEnvProvider provider;
try {
provider = (IQMakeEnvProvider) element.createExecutableExtension(ATTR_CLASS);
} catch (CoreException e) {
Activator.log("Error in class attribute of " + id, e); //$NON-NLS-1$
return null;
}
return provider.createEnv(controller);
}
/**
* Checks whether an enablement expression evaluation is true.
*
* @param controller the controller
* @return true if the provider can be used; false otherwise
*/
private boolean matches(IController controller) {
Boolean eval = evaluation.get();
if (eval != null) {
return eval.booleanValue();
}
if (enablementExpression != null) {
ICConfigurationDescription configuration = controller != null ? controller.getConfiguration() : null;
IProject project = configuration != null ? configuration.getProjectDescription().getProject() : null;
EvaluationContext evalContext = new EvaluationContext(null, project);
try {
if (project != null) {
String[] natures = project.getDescription().getNatureIds();
evalContext.addVariable(VAR_PROJECTNATURES, Arrays.asList(natures));
}
return enablementExpression.evaluate(evalContext) == EvaluationResult.TRUE;
} catch (CoreException e) {
Activator.log("Error while evaluating enablement expression for " + id, e); //$NON-NLS-1$
}
}
evaluation.set(Boolean.FALSE);
return false;
}
}

View file

@ -1,123 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.internal.qt.core.Activator;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
/**
* Represents a manager of registered qmakeEnvProvider extensions.
*/
public final class QMakeEnvProviderManager {
private static QMakeEnvProviderManager INSTANCE = new QMakeEnvProviderManager();
private final List<QMakeEnvProviderDescriptor> descriptors;
public static QMakeEnvProviderManager getInstance() {
return INSTANCE;
}
private QMakeEnvProviderManager() {
descriptors = loadDescriptors();
}
/**
* Returns a list of all registerd qmakeEnvProvider extensions.
*
* @return the list of extensions
*/
private static List<QMakeEnvProviderDescriptor> loadDescriptors() {
List<QMakeEnvProviderDescriptor> descriptors = new ArrayList<>();
IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(Activator.ID,
Activator.QMAKE_ENV_PROVIDER_EXT_POINT_NAME);
for (IConfigurationElement element : elements) {
descriptors.add(new QMakeEnvProviderDescriptor(element));
}
Collections.sort(descriptors);
return descriptors;
}
/**
* Called by QMakeProjectInfo to create IQMakeEnv for a specified IController.
* It asks each qmakeEnvProvider extensions to provide the instance. If none of them provides, then the default IQMakeEnvProvider is returned.
*
* @param controller the controller
* @return the IQMakeEnv instance for specifying the QMake environment
*/
public IQMakeEnv createEnv(IQMakeEnvProvider.IController controller) {
for (QMakeEnvProviderDescriptor descriptor : descriptors) {
IQMakeEnv env = descriptor.createEnv(controller);
if (env != null) {
return env;
}
}
return new ConfigurationQMakeEnv(controller.getConfiguration());
}
/**
* Represents a fallback IQMakeEnvProvider that is used for a project that has QtNature
* while there is no registered IQMakeEnvProvider that would provide any IQMakeEnv.
*/
private static class ConfigurationQMakeEnv implements IQMakeEnv2 {
private static final String PRO_FILE_SUFFIX = ".pro"; //$NON-NLS-1$
private static final String ENV_VAR_QMAKE = "QMAKE"; //$NON-NLS-1$
private final ICConfigurationDescription configuration;
public ConfigurationQMakeEnv(ICConfigurationDescription configuration) {
this.configuration = configuration;
}
@Override
public void init() {
}
@Override
public void destroy() {
}
/**
* Returns QMakeEnvInfo resolved from a project in a generic way.
* If exists, the root-level .pro file is resolved as the one that is located directly under the project and has the same name.
* If exists, qmake executable is resolved from "QMAKE" environment variable that is stored in the project configuration.
*
* @return the QMakeEnvInfo instance if the project configuration exists; otherwise null.
*/
@Override
public QMakeEnvInfo getQMakeEnvInfo() {
if (configuration == null) {
return null;
}
IProject project = configuration.getProjectDescription().getProject();
IFile proFile = project != null ? project.getFile(project.getName() + PRO_FILE_SUFFIX) : null;
IEnvironmentVariable variable = CCorePlugin.getDefault().getBuildEnvironmentManager()
.getVariable(ENV_VAR_QMAKE, configuration, true);
String qmakeFilePath = variable != null ? variable.getValue() : null;
return new QMakeEnvInfo(proFile, qmakeFilePath, Collections.<String, String>emptyMap(),
Collections.<IFile>emptyList());
}
}
}

View file

@ -1,216 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import org.eclipse.cdt.internal.qt.core.Activator;
import org.eclipse.cdt.utils.spawner.ProcessFactory;
/**
* Holder for QMake information.
*/
public final class QMakeInfo implements IQMakeInfo {
// reg. exp. for parsing output of "qmake -query" command
public static final Pattern PATTERN_QUERY_LINE = Pattern.compile("^(\\w+):(.*)$"); //$NON-NLS-1$
// reg. exp. for parsing output of "qmake -E file.pro" command (for QMake 3.0 only)
public static final Pattern PATTERN_EVAL_LINE = Pattern.compile("^([a-zA-Z0-9_\\.]+)\\s*=\\s*(.*)$"); //$NON-NLS-1$
/**
* Instance that is used to present an invalid IQMakeInfo.
*/
public static final IQMakeInfo INVALID = new QMakeInfo(false, Collections.<String, String>emptyMap(),
Collections.<String, String>emptyMap());
private final boolean valid;
private final Map<String, String> qmakeQueryMap;
private final IQtVersion qtVersion;
private final List<String> involvedQMakeFiles;
private final List<String> qtImportPath;
private final List<String> qtQmlPath;
private final List<String> qtDocPath;
private final List<String> includePath;
private final List<String> defines;
private final List<String> sourceFiles;
private final List<String> headerFiles;
private final List<String> resourceFiles;
private final List<String> formFiles;
private final List<String> otherFiles;
public QMakeInfo(boolean valid, Map<String, String> queryMap, Map<String, String> proMap) {
this.valid = valid;
this.qmakeQueryMap = Collections.unmodifiableMap(queryMap);
this.qtVersion = QMakeVersion.create(queryMap.get(QMakeParser.KEY_QT_VERSION));
List<String> tmpQtImportPaths = new ArrayList<>(
QMakeParser.singleValue(queryMap, QMakeParser.KEY_QT_INSTALL_IMPORTS));
List<String> tmpQtQmlPaths = new ArrayList<>(QMakeParser.singleValue(queryMap, QMakeParser.KEY_QT_INSTALL_QML));
this.qtDocPath = QMakeParser.singleValue(queryMap, QMakeParser.KEY_QT_INSTALL_DOCS);
this.involvedQMakeFiles = QMakeParser.qmake3DecodeValueList(proMap,
QMakeParser.KEY_QMAKE_INTERNAL_INCLUDED_FILES);
this.includePath = QMakeParser.qmake3DecodeValueList(proMap, QMakeParser.KEY_INCLUDEPATH);
this.defines = QMakeParser.qmake3DecodeValueList(proMap, QMakeParser.KEY_DEFINES);
this.sourceFiles = QMakeParser.qmake3DecodeValueList(proMap, QMakeParser.KEY_SOURCES);
this.headerFiles = QMakeParser.qmake3DecodeValueList(proMap, QMakeParser.KEY_HEADERS);
this.resourceFiles = QMakeParser.qmake3DecodeValueList(proMap, QMakeParser.KEY_RESOURCES);
this.formFiles = QMakeParser.qmake3DecodeValueList(proMap, QMakeParser.KEY_FORMS);
this.otherFiles = QMakeParser.qmake3DecodeValueList(proMap, QMakeParser.KEY_OTHER_FILES);
// combine qtImportPath and qtQmlPath from both qmake runs
List<String> qmlImportPath = QMakeParser.qmake3DecodeValueList(proMap, QMakeParser.KEY_QML_IMPORT_PATH);
tmpQtImportPaths.addAll(qmlImportPath);
tmpQtQmlPaths.addAll(qmlImportPath);
this.qtImportPath = Collections.unmodifiableList(tmpQtImportPaths);
this.qtQmlPath = Collections.unmodifiableList(tmpQtQmlPaths);
}
public static IQMakeInfo create(String proPath, String qmakePath, String[] extraEnv) {
if (proPath == null || qmakePath == null) {
return INVALID;
}
// run "qmake -query"
Map<String, String> qmake1;
try {
qmake1 = exec(PATTERN_QUERY_LINE, extraEnv, qmakePath, "-query"); //$NON-NLS-1$
} catch (IOException e) {
Activator.log(e);
return INVALID;
}
// check the qmake version
QMakeVersion version = QMakeVersion.create(qmake1.get(QMakeParser.KEY_QMAKE_VERSION));
// TODO - no support for pre-3.0
// for QMake version 3.0 or newer, run "qmake -E file.pro"
Map<String, String> qmake2 = Collections.emptyMap();
if (version != null && version.getMajor() >= 3) {
try {
qmake2 = exec(PATTERN_EVAL_LINE, extraEnv, qmakePath, "-E", proPath); //$NON-NLS-1$
} catch (IOException e) {
Activator.log(e);
// Continue with an empty map.
}
}
return new QMakeInfo(true, qmake1, qmake2);
}
@Override
public boolean isValid() {
return valid;
}
@Override
public Map<String, String> getQMakeQueryMap() {
return qmakeQueryMap;
}
@Override
public IQtVersion getQtVersion() {
return qtVersion;
}
@Override
public List<String> getInvolvedQMakeFiles() {
return involvedQMakeFiles;
}
@Override
public List<String> getQtImportPath() {
return qtImportPath;
}
@Override
public List<String> getQtQmlPath() {
return qtQmlPath;
}
@Override
public List<String> getQtDocPath() {
return qtDocPath;
}
@Override
public List<String> getIncludePath() {
return includePath;
}
@Override
public List<String> getDefines() {
return defines;
}
@Override
public List<String> getSourceFiles() {
return sourceFiles;
}
@Override
public List<String> getHeaderFiles() {
return headerFiles;
}
@Override
public List<String> getResourceFiles() {
return resourceFiles;
}
@Override
public List<String> getFormFiles() {
return formFiles;
}
@Override
public List<String> getOtherFiles() {
return otherFiles;
}
/**
* Executes a command and parses its output into a map.
*
* @param regex the reg. exp. used for parsing the output
* @param extraEnv the extra environment for command
* @param cmd the command line
* @return the map of resolved key-value pairs
* @throws IOException If command execution failed
*/
private static Map<String, String> exec(Pattern regex, String[] extraEnv, String... command) throws IOException {
if (command.length < 1 || !new File(command[0]).exists()) {
throw new IOException("qmake: cannot run command: " + (command.length > 0 ? command[0] : "")); //$NON-NLS-1$ //$NON-NLS-2$
}
Process process = null;
try {
if (extraEnv != null && extraEnv.length > 0) {
process = ProcessFactory.getFactory().exec(command, extraEnv);
} else {
process = ProcessFactory.getFactory().exec(command);
}
try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()))) {
return QMakeParser.parse(regex, reader);
}
} finally {
if (process != null) {
process.destroy();
}
}
}
}

View file

@ -1,218 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
import java.io.BufferedReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.cdt.internal.qt.core.Activator;
/**
* Provides a parser for QMake output.
*/
public final class QMakeParser {
public static final String KEY_QMAKE_VERSION = "QMAKE_VERSION"; //$NON-NLS-1$
public static final String KEY_QT_VERSION = "QT_VERSION"; //$NON-NLS-1$
public static final String KEY_QT_INSTALL_IMPORTS = "QT_INSTALL_IMPORTS"; //$NON-NLS-1$
public static final String KEY_QT_INSTALL_QML = "QT_INSTALL_QML"; //$NON-NLS-1$
public static final String KEY_QT_INSTALL_DOCS = "QT_INSTALL_DOCS"; //$NON-NLS-1$
public static final String KEY_QMAKE_INTERNAL_INCLUDED_FILES = "QMAKE_INTERNAL_INCLUDED_FILES"; //$NON-NLS-1$
public static final String KEY_SOURCES = "SOURCES"; //$NON-NLS-1$
public static final String KEY_HEADERS = "HEADERS"; //$NON-NLS-1$
public static final String KEY_INCLUDEPATH = "INCLUDEPATH"; //$NON-NLS-1$
public static final String KEY_DEFINES = "DEFINES"; //$NON-NLS-1$
public static final String KEY_RESOURCES = "RESOURCES"; //$NON-NLS-1$
public static final String KEY_FORMS = "FORMS"; //$NON-NLS-1$
public static final String KEY_OTHER_FILES = "OTHER_FILES"; //$NON-NLS-1$
public static final String KEY_QML_IMPORT_PATH = "QML_IMPORT_PATH"; //$NON-NLS-1$
/**
* Parses QMake output via a specified reg. exp.
*
* @param regex the reg. exp.
* @param reader the QMake output
* @return the modifiable map of parsed key-value pairs
* @throws IOException when io error happens
*/
public static Map<String, String> parse(Pattern regex, BufferedReader reader) throws IOException {
Map<String, String> result = new LinkedHashMap<>();
String line;
while ((line = reader.readLine()) != null) {
Matcher m = regex.matcher(line);
if (!m.matches() || m.groupCount() != 2) {
Activator.log("qmake: cannot decode query line '" + line + '\''); //$NON-NLS-1$
} else {
String key = m.group(1);
String value = m.group(2);
String oldValue = result.put(key, value);
if (oldValue != null)
Activator.log("qmake: duplicate keys in query info '" + line + "' was '" + oldValue + '\''); //$NON-NLS-1$ //$NON-NLS-2$
}
}
return result;
}
/**
* Returns an unmodifiable list with 0-1 values for a specific QMake variable.
*
* @param map the map
* @param key the QMake variable
* @return the unmodifiable list of values
*/
public static List<String> singleValue(Map<String, String> map, String key) {
String value = map.get(key);
return value == null ? Collections.<String>emptyList() : Collections.singletonList(value);
}
/**
* Returns an unmodifiable list of values for a specific QMake variable that is decoded as a list of values.
*
* @param map the map
* @param key the QMake variable
* @return the unmodifiable list of values
*/
public static List<String> qmake3DecodeValueList(Map<String, String> map, String key) {
String value = map.get(key);
if (value == null) {
return Collections.emptyList();
}
List<String> result = new ArrayList<>();
for (String item : qmake3SplitValueList(value)) {
result.add(qmake3DecodeValue(item));
}
return Collections.unmodifiableList(result);
}
/**
* Decodes a specified QMake variable value.
*
* @param value the value
* @return the decoded value
*/
public static String qmake3DecodeValue(String value) {
int length = value.length();
if (length >= 2 && value.charAt(0) == '"' && value.charAt(length - 1) == '"') {
value = value.substring(1, length - 1);
length = value.length();
}
StringBuilder sb = new StringBuilder(length);
for (int i = 0; i < length; i++) {
char c = value.charAt(i);
if (c == '\\') {
++i;
if (i < length) {
char next = value.charAt(i);
switch (next) {
case 'r':
sb.append('\r');
break;
case 'n':
sb.append('\n');
break;
case 't':
sb.append('\t');
break;
case '\\':
case '\'':
case '"':
sb.append(next);
break;
case 'x':
i += 2;
if (i < length) {
char first = value.charAt(i - 1);
char second = value.charAt(i);
if (first >= '0' && first <= '9' && second >= '0' && second <= '9') {
sb.append((char) ((first - '0') * 16 + (second - '0')));
}
}
}
}
} else {
sb.append(c);
}
}
return sb.toString();
}
/**
* Splits a specified QMake variable value into a list of values.
*
* @param value the value
* @return the modifiable list of values
*/
private static List<String> qmake3SplitValueList(String value) {
List<String> result = new ArrayList<>();
StringBuilder sb = new StringBuilder();
char quote = 0;
boolean hadWord = false;
final int length = value.length();
for (int i = 0; i < length; i++) {
char c = value.charAt(i);
if (quote == c) {
quote = 0;
hadWord = true;
sb.append(c);
continue;
}
switch (c) {
case '"':
case '\'':
quote = c;
hadWord = true;
break;
case ' ':
case '\t':
if (quote == 0) {
if (hadWord) {
result.add(sb.toString());
sb.delete(0, sb.length());
hadWord = false;
}
continue;
}
break;
case '\\':
if (i + 1 < length) {
char nextChar = value.charAt(i + 1);
if (nextChar == '\'' || nextChar == '"' || nextChar == '\\') {
sb.append(c);
c = nextChar;
++i;
}
}
//$FALL-THROUGH$
default:
hadWord = true;
break;
}
sb.append(c);
}
if (hadWord) {
result.add(sb.toString());
}
return Collections.unmodifiableList(result);
}
}

View file

@ -1,293 +0,0 @@
/*
* Copyright (c) 2013, 2015 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.cdt.internal.qt.core.index;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
import org.eclipse.cdt.internal.qt.core.index.IQMakeEnvProvider.IController;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
/**
* Represents a QMake project information that is based on an activate project configuration of a specified related IProject.
* Allows to resolve actual information and listen its change.
*/
public final class QMakeProjectInfo implements IQMakeProjectInfo {
private final State STATE_FREEZE = new State();
private final State STATE_INVALID = new State();
// listeners
private final List<IQMakeProjectInfoListener> listeners = new CopyOnWriteArrayList<>();
private final IProject project;
private final Object stateSync = new Object();
// represents a current state of QMakeProjectInfo
private State state = STATE_INVALID;
QMakeProjectInfo(IProject project) {
this.project = project;
}
void destroy() {
setState(STATE_FREEZE);
}
// must not be called under any QMake-related sync-lock, except for workspace lock
private void updateStateFrom(State fromState) {
synchronized (stateSync) {
if (state != fromState) {
return;
}
}
updateState();
}
// must not be called under any QMake-related sync-lock, except for workspace lock
// we are running outside of synchronized block to prevent deadlock involving workspace lock
// this means that theoretically there might be multiple thread calculating the same results but only the last one wins
State updateState() {
// note that getProjectDescription might acquire workspace lock
ICProjectDescription projectDescription = CoreModel.getDefault().getProjectDescriptionManager()
.getProjectDescription(project);
ICConfigurationDescription configuration = projectDescription != null
? projectDescription.getActiveConfiguration()
: null;
State newState = configuration != null ? new State(configuration) : STATE_INVALID;
setState(newState);
return newState;
}
private void setState(State newState) {
State oldState = null;
synchronized (stateSync) {
if (newState == null || state == newState) {
return;
}
if (state == STATE_FREEZE) {
newState.destroyBeforeInit();
return;
}
oldState = state;
state = newState;
if (oldState != null) {
oldState.destroy();
}
newState.init();
}
for (IQMakeProjectInfoListener listener : listeners) {
listener.qmakeInfoChanged();
}
}
@Override
public void addListener(IQMakeProjectInfoListener listener) {
listeners.add(listener);
}
@Override
public void removeListener(IQMakeProjectInfoListener listener) {
listeners.remove(listener);
}
IProject getProject() {
return project;
}
@Override
public IQMakeInfo getActualInfo() {
synchronized (stateSync) {
return state.getQMakeInfo();
}
}
@Override
public IQMakeInfo updateActualInfo() {
return updateState().getQMakeInfo();
}
// converts IFile to absolute path
private static String toFilePath(IFile file) {
if (file != null) {
IPath rawLocation = file.getRawLocation();
if (rawLocation != null) {
rawLocation = rawLocation.makeAbsolute();
if (rawLocation != null) {
File f = rawLocation.toFile();
if (f != null) {
return f.getAbsolutePath();
}
}
}
}
return null;
}
// checks if any of the specified files is a sensitive file
boolean containsAnySensitiveFile(Set<IPath> files) {
synchronized (stateSync) {
return state.containsAnySensitiveFile(files);
}
}
/**
* Represents a state of QMakeInfo for a specific QMakeProjectInfo.
*/
private final class State implements IController {
// an active project configuration
private final ICConfigurationDescription configuration;
// an active project qmake env
private final IQMakeEnv qmakeEnv;
// the last calculated QMake info; null if not calculated
private final IQMakeInfo qmakeInfo;
// a set of sensitive files that might affects actual QMake information
private final SensitiveSet sensitiveFilePathSet;
State() {
configuration = null;
qmakeEnv = null;
qmakeInfo = QMakeInfo.INVALID;
sensitiveFilePathSet = new SensitiveSet();
}
State(ICConfigurationDescription configuration) {
this.configuration = configuration;
// qmakeEnv created from registry of qmakeEnvProvider extensions
this.qmakeEnv = QMakeEnvProviderManager.getInstance().createEnv(this);
// retrieves IQMakeEnvInfo from IQMakeEnv
QMakeEnvInfo qmakeEnvInfo = qmakeEnv.getQMakeEnvInfo();
// retrieves .pro file path
String proFilePath = toFilePath(qmakeEnvInfo != null ? qmakeEnvInfo.getProFile() : null);
// retrieves qmake executable path
String qmakeFilePath = qmakeEnvInfo != null ? qmakeEnvInfo.getQMakeFilePath() : null;
// retries environment
List<String> envList = new ArrayList<>();
Map<String, String> envMap = qmakeEnvInfo != null ? qmakeEnvInfo.getEnvironment()
: Collections.<String, String>emptyMap();
for (Map.Entry<String, String> entry : envMap.entrySet()) {
envList.add(entry.getKey() + "=" + entry.getValue()); //$NON-NLS-1$
}
// calculates actual QMake info
qmakeInfo = QMakeInfo.create(proFilePath, qmakeFilePath, envList.toArray(new String[envList.size()]));
// calculates a new set of sensitive file paths
sensitiveFilePathSet = new SensitiveSet();
Set<IFile> envSensFiles = qmakeEnvInfo != null ? qmakeEnvInfo.getSensitiveFiles()
: Collections.<IFile>emptySet();
for (IFile sensitiveFile : envSensFiles) {
if (sensitiveFile != null) {
sensitiveFilePathSet.addSensitiveFile(sensitiveFile);
}
}
if (proFilePath != null) {
sensitiveFilePathSet.addSensitiveFile(proFilePath);
}
List<String> sensitiveFiles = qmakeInfo.getInvolvedQMakeFiles();
if (sensitiveFiles != null) {
for (String sensitiveFile : sensitiveFiles) {
sensitiveFilePathSet.addSensitiveFile(sensitiveFile);
}
}
}
private boolean containsAnySensitiveFile(Set<IPath> files) {
for (Iterator<IPath> iterator = files.iterator(); iterator.hasNext();) {
IPath path = iterator.next();
if (sensitiveFilePathSet.contains(path)) {
return true;
}
}
return false;
}
@Override
public ICConfigurationDescription getConfiguration() {
return configuration;
}
public void destroyBeforeInit() {
// see IQMakeEnv JavaDoc for details
if (qmakeEnv != null && !(qmakeEnv instanceof IQMakeEnv2)) {
qmakeEnv.destroy();
}
}
public void init() {
if (qmakeEnv instanceof IQMakeEnv2) {
((IQMakeEnv2) qmakeEnv).init();
}
}
public void destroy() {
if (qmakeEnv != null) {
qmakeEnv.destroy();
}
}
@Override
public void scheduleUpdate() {
updateStateFrom(this);
}
IQMakeInfo getQMakeInfo() {
return qmakeInfo;
}
}
private static final class SensitiveSet extends HashSet<IPath> {
private static final long serialVersionUID = 2684086006933209512L;
// adds a sensitive file in form of a specified absolute path
private void addSensitiveFile(String sensitiveFile) {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IFile[] files = root
.findFilesForLocationURI(URIUtil.toURI(Path.fromOSString(sensitiveFile).makeAbsolute()));
if (files != null && files.length > 0) {
IFile file = files[0];
addSensitiveFile(file);
}
}
// adds a sensitive file in form of a IFile
private void addSensitiveFile(IFile file) {
IPath fullPath = file.getFullPath();
if (fullPath != null) {
add(fullPath);
}
}
}
}

Some files were not shown because too many files have changed in this diff Show more