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

Provide file/folder completion for certain xml attributes #345

Closed
fbricon opened this issue Apr 4, 2019 · 1 comment · Fixed by #410
Closed

Provide file/folder completion for certain xml attributes #345

fbricon opened this issue Apr 4, 2019 · 1 comment · Fixed by #410
Assignees
Labels
completion This issue or enhancement is related to completion support enhancement New feature or request
Milestone

Comments

@fbricon
Copy link
Contributor

fbricon commented Apr 4, 2019

When an attribute is named:

  • src
  • path
  • directory
  • file
    (list could be defined in some preferences), then lsp4xml should propose file completion.
    Also, that could be triggered by any attribute value starting with the file:// scheme.

eg (html support in vscode):
Apr-04-2019 16-05-12

@fbricon fbricon added enhancement New feature or request completion This issue or enhancement is related to completion support labels Apr 4, 2019
@NikolasKomonen NikolasKomonen self-assigned this Apr 9, 2019
@NikolasKomonen NikolasKomonen added this to the v0.6.0 milestone Apr 9, 2019
@NikolasKomonen NikolasKomonen modified the milestones: v0.6.0, v0.7.0 May 21, 2019
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue May 30, 2019
Need to still handle ~ (home) and get SortTextHelper from XSDCompletion pr

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue May 31, 2019
Writing tests

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue May 31, 2019
Provides file completion when the user starts typing a path in an attribute value

Only displays `.xsd` and folders as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 3, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 4, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 4, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 4, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 4, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 4, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 4, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 5, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 5, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 5, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 5, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 5, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 5, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 5, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 5, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 5, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 5, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 6, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 6, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 7, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
@bmix
Copy link

bmix commented Jun 10, 2019

What about adding support for the xml:base attribute, valid for the current XML context, as root for the completion?

xml:base allows for links to be relative, which then get resolved by an iri-handler, by concatenating the path from the currently valid xml:base attribute with the relative reference.

Example (let the file in edition be /projects/clientA/documents/example.xml):

<document xml:base="http://example.com/documents/">
  <title>Some Title</title>
  <icon href="icon.png"/> <!-- means: 'http://example.com/documents/icon.png' -->
  <text>Lorem Ipsum and so on...</text>
  <figures xml:base="http://example.com/documents/figures/">
    <fig href="-> This triggers listing all images under '/documents/figures/'
  </figures>
</document>

Of course, this would make only sense for environments, that implement some logic to map any non file:// IRI to the local filesystem:

settings.remote.path.url = "http://example.com"
settings.local.path.url = "/projects/clientA/"

Such settings would typically be part of the project's preferences.

Resolution of the currently valid such attribute would, I believe, require the same code, as may be existing for namespace resolution, xml:lang and xml:space, because the principles are the same.

NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 10, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
fbricon pushed a commit that referenced this issue Jun 10, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes #345

Signed-off-by: Nikolas Komonen <[email protected]>
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jun 11, 2019
Provides file completion when the user starts typing a path in an attribute value

Displays all folders and files as of now.

Fixes eclipse-lemminx#345

Signed-off-by: Nikolas Komonen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completion This issue or enhancement is related to completion support enhancement New feature or request
Projects
None yet
3 participants