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

Eat existing content after apply completion without TextEdit #270

Closed
turkeylurkey opened this issue Apr 30, 2024 · 10 comments · Fixed by #276
Closed

Eat existing content after apply completion without TextEdit #270

turkeylurkey opened this issue Apr 30, 2024 · 10 comments · Fixed by #276
Assignees
Labels
bug Something isn't working completion
Milestone

Comments

@turkeylurkey
Copy link
Contributor

turkeylurkey commented Apr 30, 2024

When we type a string that contains a dot as a key and use completion then part of the key string is replaced by the replacement text and part of the key is retained. Formerly the whole key string was replaced by the replacement text. For example, we type 'com.ibm.ws.log' and see the replacement options in the editor:
image
Then select one item and see that the leading 'com.ibm.ws.' is retained rather than being replaced.
image

Another example where no dot is used. First select one replacement option.
image

Then type '=' and ctrl-space.
image

Select one of the replacement strings and all the text is replaced.
image

See #189.

@fbricon
Copy link
Contributor

fbricon commented Apr 30, 2024

can you provide the requests/responses for the completion+resolve

@angelozerr
Copy link
Contributor

Could tou share your full lsp traces

@angelozerr
Copy link
Contributor

angelozerr commented Apr 30, 2024

Just one question have you tested your usecase with our lsp4ij repository?

Have you the same problem with MPLs?

If it works or not it should be good to add a test withbyour usecase.

Please share your lsp traces

@angelozerr
Copy link
Contributor

I have installed your Liberty vscode extension and try the completion, it doesn't work (no completion):

image

But I see in vscode output:

[Trace - 12:59:05 PM] Received response 'textDocument/completion - (14)' in 4ms.
Result: [
    {
        "label": "wlp.server.name",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "The name of the server."
        }
    },
    {
        "label": "com.ibm.hpel.log.fileSwitchTime",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "Makes the server close the active log file and start a new one at the specified hour of the day. When the value for fileSwitchTime is specified, file switching is enabled, otherwise it is disabled."
        }
    },
    {
        "label": "com.ibm.hpel.trace.outOfSpaceAction",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "Specifies the action to perform when the file system where records are kept runs out of free space."
        }
    },
    {
        "label": "server.config.dir",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "The directory where the server configuration is stored. The default is `${wlp.user.dir}/servers/${wlp.server.name}`."
        }
    },
    {
        "label": "wlp.install.dir",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "The directory where the Open Liberty runtime is installed."
        }
    },
    {
        "label": "com.ibm.ws.logging.message.file.name",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "This setting specifies the name of the message log file. The message log file has a default name of `messages.log`. This file always exists, and contains INFO and other (AUDIT, WARNING, ERROR, FAILURE) messages in addition to the System.out and System.err streams. This log also contains time stamps and the issuing thread ID. If the log file is rolled over, the names of earlier log files have the format messages_timestamp.log."
        }
    },
    {
        "label": "com.ibm.hpel.log.purgeMaxSize",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "Specifies the maximum size for the binary log repository in megabytes. When the value for purgeMaxSize is specified with a value of more than `0`, cleanup based on repository size is enabled, otherwise it is disabled; a value of `0` means no limit. The default value is `50`."
        }
    },
    {
        "label": "com.ibm.ws.logging.max.files",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "This setting specifies how many of each of the logs files are kept. This setting also applies to the number of exception summary logs for FFDC. So if this number is 10, you might have 10 message logs, 10 trace logs, and 10 exception summaries in the ffdc directory. By default, the value is `2`. The console log does not roll so this setting does not apply to the console.log file."
        }
    },
    {
        "label": "com.ibm.ws.logging.max.file.size",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "This setting specifies the maximum size (in MB) that a log file can reach before it is rolled. Setting the value to `0` disables log rolling. The default value is `20`. The console.log does not roll so this setting does not apply."
        }
    },
    {
        "label": "com.ibm.hpel.trace.purgeMinTime",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "Specifies the duration, in hours, after which a server can remove a trace record. When the value for purgeMinTime is specified with a value of more than `0`, cleanup based on trace record age is enabled, otherwise it is disabled; a value of `0` means no limit. Specify a positive integer with or without the unit of time, which can only be hours (h or H). For example, specify 12 hours as `12` or `12h`."
        }
    },
    {
        "label": "org.osgi.framework.bootdelegation",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "Set if this property is required by external monitoring tools. The value is a comma-delimited list of packages. (OSGi framework extension)."
        }
    },
    {
        "label": "com.ibm.hpel.log.outOfSpaceAction",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "Specifies the action to perform when the file system where records are kept runs out of free space."
        }
    },
    {
        "label": "com.ibm.hpel.trace.fileSwitchTime",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "Makes the server close the active trace file and start a new one at the specified hour of the day. When the value for fileSwitchTime is specified, file switching is enabled, otherwise it is disabled."
        }
    },
    {
        "label": "server.output.dir",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "The directory where the server writes the workarea, logs, and other runtime-generated files. The default is `${server.config.dir}`."
        }
    },
    {
        "label": "com.ibm.ws.logging.trace.file.name",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "This setting specifies the name of the trace log file. The trace.log file is created only if additional or detailed trace is enabled. `stdout` is recognized as a special value, and causes trace to be directed to the original standard out stream."
        }
    },
    {
        "label": "com.ibm.ws.logging.copy.system.streams",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "If this setting is set to true, messages that are written to the `System.out` and `System.err` streams are copied to process stdout and stderr streams and so appear in the console.log file. If this setting is set to `false`, those messages are written to configured logs such as the `messages.log` file or `trace.log` file, but they are not copied to stdout and stderr and do not appear in console.log. The default value is `true`."
        }
    },
    {
        "label": "com.ibm.ws.logging.isoDateFormat",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "This setting specifies whether to use ISO-8601 formatted dates in log files. The default value is `false`. If this setting is set to `true`, the ISO-8601 format is used in the messages.log file, the trace.log file, and the FFDC logs. The format is `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. If you specify a value of `false`, the date and time are formatted according to the default locale set in the system. If the default locale is not found, the format is `dd/MMM/yyyy HH:mm:ss:SSS z`."
        }
    },
    {
        "label": "command.port",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "Custom property. Overrides the default behavior of the Liberty server command port."
        }
    },
    {
        "label": "osgi.console",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "Set the port for the OSGi console (OSGi framework diagnostics)."
        }
    },
    {
        "label": "default.https.port",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "Specifies the default HTTPS port. The default port is 9443, and can be overridden in the server configuration xml."
        }
    },
    {
        "label": "com.ibm.hpel.log.bufferingEnabled",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "Specifies whether to allow a small delay in saving records to the disk for improved performance. When bufferingEnabled is set to true, records will be briefly held in memory before being written to disk."
        }
    },
    {
        "label": "com.ibm.ws.logging.newLogsOnStart",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "If this setting is set to true when Open Liberty starts, any existing `messages.log` or `trace.log` files are rolled over and logging writes to a new `messages.log` or `trace.log` file. If this setting is set to false, `messages.log` or `trace.log` files only refresh when they hit the size that is specified by the `maxFileSize` attribute. The default value is `true`. This setting cannot be provided using the logging element in the `server.xml` file because it is only processed during server bootstrap."
        }
    },
    {
        "label": "shared.config.dir",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "The directory of shared configuration files. The default is `${wlp.user.dir}/shared/config`."
        }
    },
    {
        "label": "com.ibm.ws.logging.hideMessage",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "You can use this setting to configure the messages keys that you want to hide from the console.log and messages.log files. When the messages are hidden, they are redirected to the trace.log file."
        }
    },
    {
        "label": "com.ibm.hpel.trace.purgeMaxSize",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "Specifies the maximum size for the binary trace repository in megabytes. When the value for purgeMaxSize is specified with a value of more than `0`, cleanup based on repository size is enabled, otherwise it is disabled; a value of `0` means no limit. The default value is `50`."
        }
    },
    {
        "label": "com.ibm.hpel.trace.bufferingEnabled",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "Specifies whether to allow a small delay in saving records to the disk for improved performance. When bufferingEnabled is set to true, records will be briefly held in memory before being written to disk."
        }
    },
    {
        "label": "shared.resource.dir",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "The directory of shared resource files. The default is `${wlp.user.dir}/shared/resources`."
        }
    },
    {
        "label": "com.ibm.ws.logging.trace.format",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "This setting controls the format of the trace log. The default format for Liberty is `ENHANCED`. You can also use `BASIC` and `ADVANCED` formats."
        }
    },
    {
        "label": "websphere.log.provider",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "Enable binary logging for the server."
        }
    },
    {
        "label": "wlp.user.dir",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "The directory of the usr folder. The default is `${wlp.install.dir}/usr`."
        }
    },
    {
        "label": "bootstrap.include",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "Specifies another properties file to also be read during the bootstrap stage. For example, this `bootstrap.include` file can contain a common set of bootstrap properties for multiple servers to use. Set the `bootstrap.include` file to an absolute or relative path."
        }
    },
    {
        "label": "com.ibm.ws.logging.trace.specification",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "This setting is used to selectively enable trace. The log detail level specification is in the following format: `component = level`."
        }
    },
    {
        "label": "server.start.wait.time",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "Custom property. Indicated in seconds, defaults to 30 seconds, does not apply when server is started with server run command."
        }
    },
    {
        "label": "com.ibm.hpel.log.purgeMinTime",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "Specifies the duration, in hours, after which a server can remove a log record. When the value for purgeMinTime is specified with a value of more than `0`, cleanup based on log record age is enabled, otherwise it is disabled; a value of `0` means no limit. Specify a positive integer with or without the unit of time, which can only be hours (h or H). For example, specify 12 hours as `12` or `12h`."
        }
    },
    {
        "label": "default.http.port",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "Specifies the default HTTP port. The default port is 9080, and can be overridden in the server configuration xml."
        }
    },
    {
        "label": "shared.app.dir",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "The directory of shared applications. The default is `${wlp.user.dir}/shared/apps`."
        }
    },
    {
        "label": "com.ibm.ws.logging.message.source",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "This setting specifies a list of comma-separated sources that route to the messages.log file. This setting applies only when the message format is set to `json`. The valid values are `message`, `trace`, `accessLog`, `ffdc`, and `audit`. By default, messageSource is set to `message`. To use the audit source, enable the Liberty `audit-1.0` feature. To use the accessLog source you need to have configured `httpAccessLogging`."
        }
    },
    {
        "label": "com.ibm.ws.logging.log.directory",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "The directory that contains the log file. The default value is `%WLP_OUTPUT_DIR%/serverName/logs`."
        }
    },
    {
        "label": "com.ibm.ws.logging.message.format",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "This setting specifies the required format for the messages.log file. Valid values are `simple` or `json` format. By default, messageFormat is set to `simple`."
        }
    },
    {
        "label": "com.ibm.ws.logging.apps.write.json",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "When the message log or console is in JSON format, this setting allows applications to write JSON-formatted messages to those destinations, without modification."
        }
    },
    {
        "label": "com.ibm.ws.logging.console.format",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "This setting specifies the required format for the console. Valid values are `dev`, `simple`, or `json` format. By default, consoleFormat is set to `dev`."
        }
    },
    {
        "label": "com.ibm.ws.logging.console.log.level",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "This setting controls the granularity of messages that go to the console. The valid values are `INFO`, `AUDIT`, `WARNING`, `ERROR`, and `OFF`. The default is `AUDIT`. If using with the Eclipse developer tools this must be set to the default."
        }
    },
    {
        "label": "com.ibm.ws.logging.json.field.mappings",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "When logs are in JSON format, use this setting to replace default field names with new field names or to omit fields from the logs. For more information, see Configurable JSON field names."
        }
    },
    {
        "label": "com.ibm.ws.logging.console.source",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "This setting specifies a comma-separated list of sources that route to the console. It applies only when the console format is set to `json`. The valid values are `message`, `trace`, `accessLog`, `ffdc`, and `audit`. By default, consoleSource is set to `message`. To use the audit source, enable the Liberty `audit-1.0` feature. To use the accessLog source you need to have configured `httpAccessLogging`."
        }
    },
    {
        "label": "com.ibm.ws.json.access.log.fields",
        "kind": 10,
        "documentation": {
            "kind": "markdown",
            "value": "When logs are in JSON format, you can use this setting to replace the default HTTP access log JSON fields with fields that are specified by the `logFormat` attribute of the accessLogging element."
        }
    }
]

I supsect that you rproblem is with textedit that you don't generate, or if yiu don't want to use textedit, perhaps filterText could work, I don't know, but if it doesn't work on vscode it will not work on IJ.

angelozerr added a commit to angelozerr/lsp4ij that referenced this issue May 1, 2024
@angelozerr
Copy link
Contributor

angelozerr commented May 1, 2024

@turkeylurkey for completion property value, there is indeed a problem that I can reproduce with a test with #272

The test fails when completion is applied:

com.redhat.devtools.lsp4ij.features.completion.BootstrapCompletionTest
  Test testCompletionWithoutTextEditAndEmptyContent FAILED (17.4s)
  junit.framework.ComparisonFailure: expected:<com.ibm.hpel.trace.[bufferingEnabled=]false> but was:<com.ibm.hpel.trace.[]false>
      at com.redhat.devtools.lsp4ij.features.completion.BootstrapCompletionTest.testCompletionWithoutTextEditAndEmptyContent(BootstrapCompletionTest.java:47)

I will investigate the problem, but IMHO I think you should generate textEdit inside your completion for bootstrap.properties

@angelozerr angelozerr added bug Something isn't working completion labels May 1, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue May 1, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue May 1, 2024
@angelozerr angelozerr self-assigned this May 1, 2024
@angelozerr angelozerr added this to the 0.0.1 milestone May 1, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue May 1, 2024
@turkeylurkey
Copy link
Contributor Author

The reference to #189 in the original post was supposed to be a reference to the change that introduced the problem.

The issue is that in getPrefixCompletionStart() we carefully calculate the offset we want to use and store it in this.bestOffset.

int startOffset = Math.max(0, completionOffset - insertText.length());

Then in apply() we overwrite this value with a new one based on rescanning the text using Character.isJavaIdentifierPart(c)) (in LSPIJUtils.getTokenRange()).

I think this explains the change in behaviour introduced by pull request #189. We need a way to detect if bestOffset should be used or not. In the "let" sample in the comment in the code it looks like "insertText" is used. Perhaps that is the indicator to rescan the text in the document to determine the offset to use instead of bestOffset.

Here is the response from the language server and we see it is using "label" for the result. I have not tested with LSP4MP and since it uses textEdits it follows a different code path in LSP4IJ.

[Trace - 18:06:12] Received response 'textDocument/completion - (2)' in 10ms.
Result: [
  {
    "label": "com.ibm.ws.logging.message.file.name",
    "kind": 10,
    "documentation": {
      "kind": "markdown",
      "value": "This setting specifies the name of the message log file. The message log file has a default name of `messages.log`. This file always exists, and contains INFO and other (AUDIT, WARNING, ERROR, FAILURE) messages in addition to the System.out and System.err streams. This log also contains time stamps and the issuing thread ID. If the log file is rolled over, the names of earlier log files have the format messages_timestamp.log."
    }
  },
  {
    "label": "com.ibm.ws.logging.max.files",
    "kind": 10,
    "documentation": {
      "kind": "markdown",
      "value": "This setting specifies how many of each of the logs files are kept. This setting also applies to the number of exception summary logs for FFDC. So if this number is 10, you might have 10 message logs, 10 trace logs, and 10 exception summaries in the ffdc directory. By default, the value is `2`. The console log does not roll so this setting does not apply to the console.log file."
    }
  },
  {
    "label": "com.ibm.ws.logging.max.file.size",
    "kind": 10,
    "documentation": {
      "kind": "markdown",
      "value": "This setting specifies the maximum size (in MB) that a log file can reach before it is rolled. Setting the value to `0` disables log rolling. The default value is `20`. The console.log does not roll so this setting does not apply."
    }
  },
  {
    "label": "com.ibm.ws.logging.trace.file.name",
    "kind": 10,
    "documentation": {
      "kind": "markdown",
      "value": "This setting specifies the name of the trace log file. The trace.log file is created only if additional or detailed trace is enabled. `stdout` is recognized as a special value, and causes trace to be directed to the original standard out stream."
    }
  },
  {
    "label": "com.ibm.ws.logging.copy.system.streams",
    "kind": 10,
    "documentation": {
      "kind": "markdown",
      "value": "If this setting is set to true, messages that are written to the `System.out` and `System.err` streams are copied to process stdout and stderr streams and so appear in the console.log file. If this setting is set to `false`, those messages are written to configured logs such as the `messages.log` file or `trace.log` file, but they are not copied to stdout and stderr and do not appear in console.log. The default value is `true`."
    }
  },
  {
    "label": "com.ibm.ws.logging.isoDateFormat",
    "kind": 10,
    "documentation": {
      "kind": "markdown",
      "value": "This setting specifies whether to use ISO-8601 formatted dates in log files. The default value is `false`. If this setting is set to `true`, the ISO-8601 format is used in the messages.log file, the trace.log file, and the FFDC logs. The format is `yyyy-MM-dd\u0027T\u0027HH:mm:ss.SSSZ`. If you specify a value of `false`, the date and time are formatted according to the default locale set in the system. If the default locale is not found, the format is `dd/MMM/yyyy HH:mm:ss:SSS z`."
    }
  },
  {
    "label": "com.ibm.ws.logging.newLogsOnStart",
    "kind": 10,
    "documentation": {
      "kind": "markdown",
      "value": "If this setting is set to true when Open Liberty starts, any existing `messages.log` or `trace.log` files are rolled over and logging writes to a new `messages.log` or `trace.log` file. If this setting is set to false, `messages.log` or `trace.log` files only refresh when they hit the size that is specified by the `maxFileSize` attribute. The default value is `true`. This setting cannot be provided using the logging element in the `server.xml` file because it is only processed during server bootstrap."
    }
  },
  {
    "label": "com.ibm.ws.logging.hideMessage",
    "kind": 10,
    "documentation": {
      "kind": "markdown",
      "value": "You can use this setting to configure the messages keys that you want to hide from the console.log and messages.log files. When the messages are hidden, they are redirected to the trace.log file."
    }
  },
  {
    "label": "com.ibm.ws.logging.trace.format",
    "kind": 10,
    "documentation": {
      "kind": "markdown",
      "value": "This setting controls the format of the trace log. The default format for Liberty is `ENHANCED`. You can also use `BASIC` and `ADVANCED` formats."
    }
  },
  {
    "label": "com.ibm.ws.logging.trace.specification",
    "kind": 10,
    "documentation": {
      "kind": "markdown",
      "value": "This setting is used to selectively enable trace. The log detail level specification is in the following format: `component \u003d level`."
    }
  },
  {
    "label": "com.ibm.ws.logging.message.source",
    "kind": 10,
    "documentation": {
      "kind": "markdown",
      "value": "This setting specifies a list of comma-separated sources that route to the messages.log file. This setting applies only when the message format is set to `json`. The valid values are `message`, `trace`, `accessLog`, `ffdc`, and `audit`. By default, messageSource is set to `message`. To use the audit source, enable the Liberty `audit-1.0` feature. To use the accessLog source you need to have configured `httpAccessLogging`."
    }
  },
  {
    "label": "com.ibm.ws.logging.log.directory",
    "kind": 10,
    "documentation": {
      "kind": "markdown",
      "value": "The directory that contains the log file. The default value is `%WLP_OUTPUT_DIR%/serverName/logs`."
    }
  },
  {
    "label": "com.ibm.ws.logging.message.format",
    "kind": 10,
    "documentation": {
      "kind": "markdown",
      "value": "This setting specifies the required format for the messages.log file. Valid values are `simple` or `json` format. By default, messageFormat is set to `simple`."
    }
  },
  {
    "label": "com.ibm.ws.logging.apps.write.json",
    "kind": 10,
    "documentation": {
      "kind": "markdown",
      "value": "When the message log or console is in JSON format, this setting allows applications to write JSON-formatted messages to those destinations, without modification."
    }
  },
  {
    "label": "com.ibm.ws.logging.console.format",
    "kind": 10,
    "documentation": {
      "kind": "markdown",
      "value": "This setting specifies the required format for the console. Valid values are `dev`, `simple`, or `json` format. By default, consoleFormat is set to `dev`."
    }
  },
  {
    "label": "com.ibm.ws.logging.console.log.level",
    "kind": 10,
    "documentation": {
      "kind": "markdown",
      "value": "This setting controls the granularity of messages that go to the console. The valid values are `INFO`, `AUDIT`, `WARNING`, `ERROR`, and `OFF`. The default is `AUDIT`. If using with the Eclipse developer tools this must be set to the default."
    }
  },
  {
    "label": "com.ibm.ws.logging.json.field.mappings",
    "kind": 10,
    "documentation": {
      "kind": "markdown",
      "value": "When logs are in JSON format, use this setting to replace default field names with new field names or to omit fields from the logs. For more information, see Configurable JSON field names."
    }
  },
  {
    "label": "com.ibm.ws.logging.console.source",
    "kind": 10,
    "documentation": {
      "kind": "markdown",
      "value": "This setting specifies a comma-separated list of sources that route to the console. It applies only when the console format is set to `json`. The valid values are `message`, `trace`, `accessLog`, `ffdc`, and `audit`. By default, consoleSource is set to `message`. To use the audit source, enable the Liberty `audit-1.0` feature. To use the accessLog source you need to have configured `httpAccessLogging`."
    }
  }
]

@angelozerr
Copy link
Contributor

After re reading the lsp spec when completion item has no textedit the lsp client must compute the Word range.

We did that with tokenRange utility , I will rename to getWordRangeAt.

But we need to improve it by using too psi élément range if it is relevant.

Indeed in your case you have a property key which can have some dot so our generic tokenRange will not cover the full property key.

To improve that in our case we should use the psi élément which is the psi property key to replace the full propery key when completion is applied.

We could use too texmatr info for another case.

I will work on that and I will add another test with mp and qute ls completion.

But IMHO it is better to report completion with textedit.

I wonder if in eclipse ide with lsp4e you have this sale problem?

@angelozerr
Copy link
Contributor

And thanks for your lsp traces but I have already collected from vscode and start to write some tests with thise traces

@turkeylurkey
Copy link
Contributor Author

Yes, I just noticed that my trace was basically the same as what you had! :)

@TrevCraw
Copy link

TrevCraw commented May 2, 2024

@angelozerr

I wonder if in eclipse ide with lsp4e you have this sale problem?

I tested with Liberty Tools for Eclipse v24.0.3 and did not hit this issue.

eclipse-completion.mp4

angelozerr added a commit to angelozerr/lsp4ij that referenced this issue May 3, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue May 3, 2024
@angelozerr angelozerr changed the title Completion errors using certain keys Eat existing content after apply completion without TextEdit May 3, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue May 3, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue May 3, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue May 3, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue May 3, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue May 3, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working completion
Projects
None yet
4 participants