From 001d0df8cc05a9aa30296f68be47229504cf9c9b Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 15 Aug 2023 11:54:14 +0200 Subject: [PATCH 1/2] add more license type --- .../editor/src/lib/providers/quickfixes.ts | 170 ++++++++++++------ .../src/lib/tree-view-item/tree-view-item.tsx | 2 +- 2 files changed, 115 insertions(+), 57 deletions(-) diff --git a/libs/remix-ui/editor/src/lib/providers/quickfixes.ts b/libs/remix-ui/editor/src/lib/providers/quickfixes.ts index 023779a5f9c..0161513990c 100644 --- a/libs/remix-ui/editor/src/lib/providers/quickfixes.ts +++ b/libs/remix-ui/editor/src/lib/providers/quickfixes.ts @@ -1,58 +1,116 @@ export default { - "Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: \" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.": [{ - "id": 1.1, - "nodeType": "SourceUnit", - "title": "Add open-source license", - "message": "// SPDX-License-Identifier: GPL-3.0" - },{ - "id": 1.2, - "nodeType": "SourceUnit", - "title": "Add non-open-source license", - "message": "// SPDX-License-Identifier: UNLICENSED" - }], - "Warning: Source file does not specify required compiler version! Consider adding" : [{ - "id": 2, - "title": "Add Solidity pragma", - "message": "pragma solidity ^0.*.*;", - "nodeType": "PragmaDirective", - "range": { - startLineNumber: 2, - endLineNumber: 2, - startColumn: 1, - endColumn: 1 + 'Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: " to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.': + [ + { + id: 1.1, + nodeType: 'SourceUnit', + title: 'Add open-source license', + message: '// SPDX-License-Identifier: GPL-3.0-only' + }, + { + id: 1.2, + nodeType: 'SourceUnit', + title: 'Add non-open-source license', + message: '// SPDX-License-Identifier: UNLICENSED' + }, + { + id: 1.3, + nodeType: 'SourceUnit', + title: 'Apache-1.1', + message: '// SPDX-License-Identifier: Apache-1.1' + }, + { + id: 1.4, + nodeType: 'SourceUnit', + title: 'Apache-2.0', + message: '// SPDX-License-Identifier: Apache-2.0' + }, + { + id: 1.5, + nodeType: 'SourceUnit', + title: 'MIT', + message: '// SPDX-License-Identifier: MIT' + }, + { + id: 1.6, + nodeType: 'SourceUnit', + title: 'EPL-1.0 (Eclipse)', + message: '// SPDX-License-Identifier: EPL-1.0' + }, + { + id: 1.7, + nodeType: 'SourceUnit', + title: 'EPL-2.0 (Eclipse)', + message: '// SPDX-License-Identifier: EPL-2.0' + }, + { + id: 1.8, + nodeType: 'SourceUnit', + title: 'GPL-3.0-only', + message: '// SPDX-License-Identifier: GPL-3.0-only' + }, + { + id: 1.9, + nodeType: 'SourceUnit', + title: 'GPL-3.0-or-later', + message: '// SPDX-License-Identifier: GPL-3.0-or-later' + } + ], + 'Warning: Source file does not specify required compiler version! Consider adding': + [ + { + id: 2, + title: 'Add Solidity pragma', + message: 'pragma solidity ^0.*.*;', + nodeType: 'PragmaDirective', + range: { + startLineNumber: 2, + endLineNumber: 2, + startColumn: 1, + endColumn: 1 + } + } + ], + 'SyntaxError: No visibility specified. Did you intend to add "public"': [ + { + id: 3.1, + title: "Add visibility 'public'", + message: 'public ', + nodeType: 'FunctionDefinition' + }, + { + id: 3.2, + title: "Add visibility 'private'", + message: 'private ', + nodeType: 'FunctionDefinition' + }, + { + id: 3.3, + title: "Add visibility 'internal'", + message: 'internal ', + nodeType: 'FunctionDefinition' + }, + { + id: 3.4, + title: "Add visibility 'external'", + message: 'external ', + nodeType: 'FunctionDefinition' } - }], - "SyntaxError: No visibility specified. Did you intend to add \"public\"": [{ - "id": 3.1, - "title": "Add visibility 'public'", - "message": "public ", - "nodeType": "FunctionDefinition" - },{ - "id": 3.2, - "title": "Add visibility 'private'", - "message": "private ", - "nodeType": "FunctionDefinition" - },{ - "id": 3.3, - "title": "Add visibility 'internal'", - "message": "internal ", - "nodeType": "FunctionDefinition" - },{ - "id": 3.4, - "title": "Add visibility 'external'", - "message": "external ", - "nodeType": "FunctionDefinition" - }], - "Warning: Function state mutability can be restricted to view": [{ - "id": 4, - "title": "Add mutability 'view'", - "message": "view ", - "nodeType": "FunctionDefinition" - }], - "Warning: Function state mutability can be restricted to pure": [{ - "id": 5, - "title": "Add mutability 'pure'", - "message": "pure ", - "nodeType": "FunctionDefinition" - }] -} \ No newline at end of file + ], + 'Warning: Function state mutability can be restricted to view': [ + { + id: 4, + title: "Add mutability 'view'", + message: 'view ', + nodeType: 'FunctionDefinition' + } + ], + 'Warning: Function state mutability can be restricted to pure': [ + { + id: 5, + title: "Add mutability 'pure'", + message: 'pure ', + nodeType: 'FunctionDefinition' + } + ] +} diff --git a/libs/remix-ui/tree-view/src/lib/tree-view-item/tree-view-item.tsx b/libs/remix-ui/tree-view/src/lib/tree-view-item/tree-view-item.tsx index ba0d281d330..b0b275e60f6 100644 --- a/libs/remix-ui/tree-view/src/lib/tree-view-item/tree-view-item.tsx +++ b/libs/remix-ui/tree-view/src/lib/tree-view-item/tree-view-item.tsx @@ -48,7 +48,7 @@ export const TreeViewItem = (props: TreeViewItemProps) => { ) : icon ? (
) : null} - {label} + {label} {isExpanded ? children : null} From 74b3a4ea14f654473c7c02ef9dc7bef168399c37 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 16 Aug 2023 09:38:09 +0200 Subject: [PATCH 2/2] fix label for license quick fixes --- .../editor/src/lib/providers/quickfixes.ts | 34 ++++++++----------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/libs/remix-ui/editor/src/lib/providers/quickfixes.ts b/libs/remix-ui/editor/src/lib/providers/quickfixes.ts index 0161513990c..a93834674de 100644 --- a/libs/remix-ui/editor/src/lib/providers/quickfixes.ts +++ b/libs/remix-ui/editor/src/lib/providers/quickfixes.ts @@ -4,55 +4,49 @@ export default { { id: 1.1, nodeType: 'SourceUnit', - title: 'Add open-source license', - message: '// SPDX-License-Identifier: GPL-3.0-only' - }, - { - id: 1.2, - nodeType: 'SourceUnit', title: 'Add non-open-source license', message: '// SPDX-License-Identifier: UNLICENSED' }, { - id: 1.3, + id: 1.2, nodeType: 'SourceUnit', - title: 'Apache-1.1', + title: 'Add Apache-1.1 license', message: '// SPDX-License-Identifier: Apache-1.1' }, { - id: 1.4, + id: 1.3, nodeType: 'SourceUnit', - title: 'Apache-2.0', + title: 'Add Apache-2.0 license', message: '// SPDX-License-Identifier: Apache-2.0' }, { - id: 1.5, + id: 1.4, nodeType: 'SourceUnit', - title: 'MIT', + title: 'Add MIT license', message: '// SPDX-License-Identifier: MIT' }, { - id: 1.6, + id: 1.5, nodeType: 'SourceUnit', - title: 'EPL-1.0 (Eclipse)', + title: 'Add EPL-1.0 (Eclipse) license', message: '// SPDX-License-Identifier: EPL-1.0' }, { - id: 1.7, + id: 1.6, nodeType: 'SourceUnit', - title: 'EPL-2.0 (Eclipse)', + title: 'Add EPL-2.0 (Eclipse) license', message: '// SPDX-License-Identifier: EPL-2.0' }, { - id: 1.8, + id: 1.7, nodeType: 'SourceUnit', - title: 'GPL-3.0-only', + title: 'Add GPL-3.0-only license', message: '// SPDX-License-Identifier: GPL-3.0-only' }, { - id: 1.9, + id: 1.8, nodeType: 'SourceUnit', - title: 'GPL-3.0-or-later', + title: 'Add GPL-3.0-or-later license', message: '// SPDX-License-Identifier: GPL-3.0-or-later' } ],