From 48c340b5a4a3793da420685eeb8d308c07eaa0e7 Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 10 Dec 2016 10:54:31 +0800 Subject: [PATCH 1/4] fixed update to base 1.0 --- lib/ConstantDetailsView.js | 6 +++--- lib/Main.js | 4 +++- lib/MethodDetailsView.js | 18 ++++++++++++++---- lib/PropertyDetailsView.js | 20 +++++++++++++++----- lib/StaticMethodDetailsView.js | 26 +++++++++++++++++++------- lib/StaticPropertyDetailsView.js | 27 ++++++++++++++++++++------- package.json | 2 +- 7 files changed, 75 insertions(+), 28 deletions(-) diff --git a/lib/ConstantDetailsView.js b/lib/ConstantDetailsView.js index 61d8146..714f729 100644 --- a/lib/ConstantDetailsView.js +++ b/lib/ConstantDetailsView.js @@ -8,12 +8,12 @@ module.exports = function ConstantDetailsView(constant) {
Name

${constant.name}

Type
-

${constant.return.resolvedType}

+

${constant.resolvedTypes}

Declared in

${constant.declaringStructure.name}

- ${_.isNil(constant.descriptions.short) ? `` : ` + ${_.isNil(constant.shortDescription) ? `` : `
Description
-

${constant.descriptions.short}

+

${constant.shortDescription}

`} `; diff --git a/lib/Main.js b/lib/Main.js index ebf281e..f633d63 100644 --- a/lib/Main.js +++ b/lib/Main.js @@ -151,7 +151,9 @@ module.exports = { this.updatePanel(atom.views.getView(figuresModel)); }); } - var onError = (e) => console.warn(UPDATING_FAILED_MESSAGE, e.message); + var onError = (e) => { + console.warn(UPDATING_FAILED_MESSAGE, e); + } var path = editor.buffer.file.path; this.service.getClassListForFile(path, true).then(onSuccess, onError); diff --git a/lib/MethodDetailsView.js b/lib/MethodDetailsView.js index 1a6affd..87d7cf8 100644 --- a/lib/MethodDetailsView.js +++ b/lib/MethodDetailsView.js @@ -3,6 +3,7 @@ import _ from 'lodash'; module.exports = function MethodDetailsView(method) { + //console.log(method); return `
Name
@@ -19,10 +20,19 @@ module.exports = function MethodDetailsView(method) { `)}
`} -
Returns
-

- ${_.map(method.returnTypes, 'resolvedType').join(', ')} -

+ + ${ + _.isEmpty(method.returnTypes) ? `` : ` +
+
Returns
+ ${_.map(method.returnTypes, (r) => ` + + ${r.type} $${r.resolvedType} + + `)} +
+ `} + ${ _.isNil(method.shortDescription) || _.isEmpty(method.shortDescription)? diff --git a/lib/PropertyDetailsView.js b/lib/PropertyDetailsView.js index e7180fd..c2e622d 100644 --- a/lib/PropertyDetailsView.js +++ b/lib/PropertyDetailsView.js @@ -3,18 +3,28 @@ import _ from 'lodash'; module.exports = function PropertyDetailsView(property) { + console.log(property); return `
Name

${property.name}

-
Type
-

- ${_.map(property.types, 'resolvedType').join(', ')} -

+ + ${ + _.isEmpty(property.types) ? `` : ` +
+
Type
+ ${_.map(property.types, (t) => ` + + ${t.type} $${t.resolvedType} + + `)} +
+ `} +
Declared in

${property.declaringStructure.name}

${_.isNil(property.shortDescription) ? `` : ` -
Description
+
Description

${property.shortDescription}

`}
diff --git a/lib/StaticMethodDetailsView.js b/lib/StaticMethodDetailsView.js index 621e144..e05429b 100644 --- a/lib/StaticMethodDetailsView.js +++ b/lib/StaticMethodDetailsView.js @@ -3,6 +3,7 @@ import _ from 'lodash'; module.exports = function StaticMethodDetailsView(staticMethod) { + console.log(staticMethod); return `
Name
@@ -11,22 +12,33 @@ module.exports = function StaticMethodDetailsView(staticMethod) {

${staticMethod.declaringStructure.name}

${_.isEmpty(staticMethod.parameters) ? `` : `
-
Parameters
+
参数
${_.map(staticMethod.parameters, (p) => ` + ${_.map(p.types,(pp)=>`${pp.type}`)} + $${p.name} + + `)} +
+ `} + + ${ + _.isEmpty(staticMethod.returnTypes) ? `` : ` +
+
Returns
+ ${_.map(staticMethod.returnTypes, (t) => ` - ${p.type} $${p.name} + ${t.type} $${t.resolvedType} `)}
`} -
Returns
-

${staticMethod.return.resolvedType}

+ ${ - _.isNil(staticMethod.descriptions.short) - || _.isEmpty(staticMethod.descriptions.short)? + _.isNil(staticMethod.shortDescription) + || _.isEmpty(staticMethod.shortDescription)? `` : `
Description
-

${staticMethod.descriptions.short}

` +

${staticMethod.shortDescription}

` }
`; diff --git a/lib/StaticPropertyDetailsView.js b/lib/StaticPropertyDetailsView.js index 3292c1b..a931cdc 100644 --- a/lib/StaticPropertyDetailsView.js +++ b/lib/StaticPropertyDetailsView.js @@ -3,17 +3,30 @@ import _ from 'lodash'; module.exports = function StaticPropertyDetailsView(staticProperty) { + console.log(staticProperty); return `
-
Name
+
Name

${staticProperty.name}

-
Type
-

${staticProperty.return.resolvedType}

-
Declared in
+ + ${ + _.isEmpty(staticProperty.types) ? `` : ` +
+
Type
+ ${_.map(staticProperty.types, (t) => ` + + ${t.type} $${t.resolvedType} + + `)} +
+ `} + +
Declared in

${staticProperty.declaringStructure.name}

- ${_.isNil(staticProperty.descriptions.short) ? `` : ` -
Description
-

${staticProperty.descriptions.short}

+ + ${_.isNil(staticProperty.shortDescription) ? `` : ` +
Description
+

${staticProperty.shortDescription}

`}
`; diff --git a/package.json b/package.json index 58c7844..ab18ef1 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "consumedServices": { "php-integrator.service": { "versions": { - "~1.0": "init" + "^1.0": "init" } } }, From 086881e78f02f3bafaed591b6f258becb98b54cf Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 10 Dec 2016 11:22:11 +0800 Subject: [PATCH 2/4] fixed css --- lib/ConstantDetailsView.js | 22 +++++++++++++++++----- lib/MethodDetailsView.js | 22 +++++++++++----------- lib/PropertiesListView.js | 1 + lib/PropertyDetailsView.js | 11 ++++++----- lib/StaticMethodDetailsView.js | 14 +++++++------- lib/StaticPropertiesListView.js | 1 + lib/StaticPropertyDetailsView.js | 8 ++++---- 7 files changed, 47 insertions(+), 32 deletions(-) diff --git a/lib/ConstantDetailsView.js b/lib/ConstantDetailsView.js index 714f729..7eb2dfb 100644 --- a/lib/ConstantDetailsView.js +++ b/lib/ConstantDetailsView.js @@ -5,14 +5,26 @@ import _ from 'lodash'; module.exports = function ConstantDetailsView(constant) { return `
-
Name
+
Name

${constant.name}

-
Type
-

${constant.resolvedTypes}

-
Declared in
+ + ${ + _.isEmpty(constant.types) ? `` : ` +

+

Type
+ ${_.map(constant.types, (t) => ` + + ${t.type} $${t.resolvedType} + + `)} +

+ `} + +
Declared in

${constant.declaringStructure.name}

+ ${_.isNil(constant.shortDescription) ? `` : ` -
Description
+
Description

${constant.shortDescription}

`}
diff --git a/lib/MethodDetailsView.js b/lib/MethodDetailsView.js index 87d7cf8..5c75f26 100644 --- a/lib/MethodDetailsView.js +++ b/lib/MethodDetailsView.js @@ -3,41 +3,41 @@ import _ from 'lodash'; module.exports = function MethodDetailsView(method) { - //console.log(method); + return `
-
Name
+
Name

${method.name}

-
Declared in
+
Declared in

${method.declaringStructure.name}

${_.isEmpty(method.parameters) ? `` : ` -
-
Parameters
+

+

Parameters
${_.map(method.parameters, (p) => ` ${p.type} $${p.name} - `)} -
+ `).join('
')} +

`} ${ _.isEmpty(method.returnTypes) ? `` : ` -
-
Returns
+

+

Returns
${_.map(method.returnTypes, (r) => ` ${r.type} $${r.resolvedType} `)} -
+

`} ${ _.isNil(method.shortDescription) || _.isEmpty(method.shortDescription)? `` : - `
Description
+ `
Description

${method.shortDescription}

` }
diff --git a/lib/PropertiesListView.js b/lib/PropertiesListView.js index 3056ce2..02c75e1 100644 --- a/lib/PropertiesListView.js +++ b/lib/PropertiesListView.js @@ -4,6 +4,7 @@ import _ from 'lodash'; import PropertyDetailsView from './PropertyDetailsView'; module.exports = function PropertiesListView(properties, currentFigureName) { + return _.isEmpty(properties) ? `` : `
${_.map(properties, (property) => ` diff --git a/lib/PropertyDetailsView.js b/lib/PropertyDetailsView.js index c2e622d..d19d081 100644 --- a/lib/PropertyDetailsView.js +++ b/lib/PropertyDetailsView.js @@ -3,26 +3,27 @@ import _ from 'lodash'; module.exports = function PropertyDetailsView(property) { - console.log(property); + return `
-
Name
+
Name

${property.name}

${ _.isEmpty(property.types) ? `` : ` -
+

Type
${_.map(property.types, (t) => ` ${t.type} $${t.resolvedType} `)} -
+

`} -
Declared in
+
Declared in

${property.declaringStructure.name}

+ ${_.isNil(property.shortDescription) ? `` : `
Description

${property.shortDescription}

diff --git a/lib/StaticMethodDetailsView.js b/lib/StaticMethodDetailsView.js index e05429b..a5ac514 100644 --- a/lib/StaticMethodDetailsView.js +++ b/lib/StaticMethodDetailsView.js @@ -3,28 +3,28 @@ import _ from 'lodash'; module.exports = function StaticMethodDetailsView(staticMethod) { - console.log(staticMethod); + return `
-
Name
+
Name

${staticMethod.name}

-
Declared in
+
Declared in

${staticMethod.declaringStructure.name}

${_.isEmpty(staticMethod.parameters) ? `` : `
-
参数
+
Parameters
${_.map(staticMethod.parameters, (p) => ` ${_.map(p.types,(pp)=>`${pp.type}`)} $${p.name} - `)} + `).join('
')}
`} ${ _.isEmpty(staticMethod.returnTypes) ? `` : `
-
Returns
+
Returns
${_.map(staticMethod.returnTypes, (t) => ` ${t.type} $${t.resolvedType} @@ -37,7 +37,7 @@ module.exports = function StaticMethodDetailsView(staticMethod) { _.isNil(staticMethod.shortDescription) || _.isEmpty(staticMethod.shortDescription)? `` : - `
Description
+ `
Description

${staticMethod.shortDescription}

` }
diff --git a/lib/StaticPropertiesListView.js b/lib/StaticPropertiesListView.js index 688b8d6..cc44463 100644 --- a/lib/StaticPropertiesListView.js +++ b/lib/StaticPropertiesListView.js @@ -4,6 +4,7 @@ import _ from 'lodash'; import StaticPropertyDetailsView from './StaticPropertyDetailsView'; module.exports = function StaticPropertiesListView(staticProperties, currentFigureName) { + return _.isEmpty(staticProperties) ? `` : `
${_.map(staticProperties, (staticProperty) => ` diff --git a/lib/StaticPropertyDetailsView.js b/lib/StaticPropertyDetailsView.js index a931cdc..9862b21 100644 --- a/lib/StaticPropertyDetailsView.js +++ b/lib/StaticPropertyDetailsView.js @@ -3,7 +3,7 @@ import _ from 'lodash'; module.exports = function StaticPropertyDetailsView(staticProperty) { - console.log(staticProperty); + return `
Name
@@ -11,14 +11,14 @@ module.exports = function StaticPropertyDetailsView(staticProperty) { ${ _.isEmpty(staticProperty.types) ? `` : ` -
-
Type
+

+

Type
${_.map(staticProperty.types, (t) => ` ${t.type} $${t.resolvedType} `)} -
+

`}
Declared in
From 1dbcda6c0557abd9715882a8661d61da59f52d6a Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 10 Dec 2016 11:24:05 +0800 Subject: [PATCH 3/4] update 0.7.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ab18ef1..5f19ff3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "php-integrator-symbol-viewer", "main": "./lib/Main", - "version": "0.6.4", + "version": "0.7.0", "description": "Atom package providing side panel with class information.", "repository": "https://github.com/tocjent/php-integrator-symbol-viewer.git", "license": "GPL-3.0", From cd24a97986baa5d4659632a37160336de9d1e63e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20P=C3=A9rez?= Date: Sat, 10 Dec 2016 18:24:54 +0100 Subject: [PATCH 4/4] Sync with php-integrator-base 2.0 --- package.json | 2 +- styles/php-integrator-symbol-viewer.less | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 5f19ff3..d471673 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "consumedServices": { "php-integrator.service": { "versions": { - "^1.0": "init" + "^2.0": "init" } } }, diff --git a/styles/php-integrator-symbol-viewer.less b/styles/php-integrator-symbol-viewer.less index 4f1cfd4..e82051b 100644 --- a/styles/php-integrator-symbol-viewer.less +++ b/styles/php-integrator-symbol-viewer.less @@ -22,7 +22,6 @@ atom-php-integrator-symbol-viewer { background: @app-background-color; .toggle-button-container { - flex: 0; display: flex; align-items: center; justify-content: flex-end; @@ -54,7 +53,7 @@ atom-php-integrator-symbol-viewer atom-php-integrator-symbol-viewer-content { min-height: 150px; overflow-y: auto; flex-direction: column; - font-size: 1.2em; + font-size: 1.0em; .highlighted-letter { color: @text-color-highlight !important; @@ -70,6 +69,7 @@ atom-php-integrator-symbol-viewer atom-php-integrator-symbol-viewer-content { .figure-choice { color: @text-color !important; background-color: @app-background-color !important; + font-size: 1.1em; } } @@ -120,7 +120,7 @@ atom-php-integrator-symbol-viewer atom-php-integrator-symbol-viewer-content { .bullet { flex-grow: 0; - font-size: 1.2em; + font-size: 1.0em; width: 1.5em; font-weight: 900; text-align: right; @@ -138,7 +138,7 @@ atom-php-integrator-symbol-viewer atom-php-integrator-symbol-viewer-content { .info { flex-grow: 0; - font-size: 1.5em; + font-size: 1.0em; display: inline-block; width: 1.5em; margin-left: 0.5em; @@ -196,6 +196,10 @@ atom-php-integrator-symbol-viewer atom-php-integrator-symbol-viewer-content { flex-grow: 0; flex-shrink: 0; padding: @component-padding @component-padding * 1.5; + + .setting-title { + font-size: 1.0em; + } } .search-container {