Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/copy books configurable extensions #1479

Merged

Conversation

lxpdd
Copy link
Contributor

@lxpdd lxpdd commented Jul 18, 2022

No description provided.

lxpdd added 12 commits July 8, 2022 10:24
1. Remove COBOL Copybook language id from package.json
2. Add .cpy and .copy file extensions to "cobol" language id
3. Remove
"onLanguage:COBOL Copybook" activation event
"COBOL Copybook" language grammar ("contributes.grammar" section in package json)
"COBOL Copybook" snippets ("contributes.snippets" section in package json)
"COBOL Copybook" configurationDefaults
4. Add a new setting "cobol-lsp.cpy-manager.copybook-extensions" (array or strings) with default [".CPY", ".COPY", ".cpy", ".copy"]
del SettingsService::toStrings because it breaks encapsulation and is being used as static method
…om "cobol-lsp.cpy-manager.copybook-extensions" and if it does treat it as a copybook (no analysis)
cobol-lsp.copybook-resolve.ert.cbl.ABC.COBOL
but also:
cobol-lsp.copybook-resolve.ert.cbl.ABC.CPY.COBOL
and use an extension from server response
# Conflicts:
#	clients/cobol-lsp-vscode-extension/package.json
#	server/engine/src/main/java/org/eclipse/lsp/cobol/service/delegates/completions/CompletionStorage.java
#	server/engine/src/test/java/org/eclipse/lsp/cobol/service/delegates/completions/SnippetCompletionTest.java
@lxpdd lxpdd changed the title [WIP] Feature/copy books configurable extensions feature/copy books configurable extensions Jul 18, 2022
@lxpdd
Copy link
Contributor Author

lxpdd commented Jul 18, 2022

☝️ please review @Nurkambay @shciubrcom @niharikasw91

@ishche ishche requested review from niharikasw91 and Nurkambay and removed request for niharikasw91 July 18, 2022 12:05
@lxpdd lxpdd requested a review from ishche July 18, 2022 12:43
@@ -94,7 +94,7 @@ private void fillInStorage(Map<String, T> props) {
props.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
}

private void getDialectArray(List<Object> dialectObject) {
private void updateDialects(List<Object> dialectObject) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

"default": [
".CPY",
".COPY",
".cpy",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please look out for the (.) prefix.

Copy link
Contributor

@niharikasw91 niharikasw91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following are the observations:

  1. Autocomplete suggestion for copybook name should be unique ( xyz.cpy and xyz.COPY should be shown only once)
  2. With (.) as prefix the extensions are not recognised
  3. Do we need to have default .cpy in case of no extensions are defined in the extension settings?
  4. When the extension has setting started with (.) the defauly .cpy file is picked and the file name is converted from small_case to upper case

@lxpdd
Copy link
Contributor Author

lxpdd commented Jul 25, 2022

@niharikasw91

Following are the observations:

  1. Autocomplete suggestion for copybook name should be unique ( xyz.cpy and xyz.COPY should be shown only once)
  2. With (.) as prefix the extensions are not recognised
  3. Do we need to have default .cpy in case of no extensions are defined in the extension settings?
  4. When the extension has setting started with (.) the defauly .cpy file is picked and the file name is converted from small_case to upper case

1 - resolved
2 - resolved, also "" as empty extension is supported now (tested for local file, and not for downloading)
3 - removed, now no extensions is supported when there isn't extension list in the config
4 - couldn't reproduce it, couldn't even test (both linux and windows environment, I couldn't see upper_case and lower_case files in VS Code at the same time, probably should be reported to VS Code team, maybe related to that issue: microsoft/vscode#94307)

@VitGottwald
Copy link
Contributor

LGTM. @ishche, @ap891843, could you, please, give it a quick look and if ok approve?

@@ -14,9 +14,10 @@
*/
package org.eclipse.lsp.cobol.service.mocks;

import com.google.common.collect.ImmutableList;
import com.google.gson.JsonPrimitive;
//import com.google.common.collect.ImmutableList;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls remove the commented code

@@ -124,7 +124,7 @@ public String readFromInputStream(InputStream inputStream, Charset charset) thro

@Override
public List<String> listFilesInDirectory(Path path) {
try (Stream<Path> streamPath = Files.list(path)) {
try (Stream<Path> streamPath = Files.walk(path, 2)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did not undestand logic behind maxDepth to 2

@ishche ishche merged commit f024751 into eclipse-che4z:development Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants