You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "rt320 (via GitHub)" <gi...@apache.org> on 2023/02/20 13:52:03 UTC

[GitHub] [daffodil-vscode] rt320 opened a new pull request, #458: Significant modifications made to intellisense results

rt320 opened a new pull request, #458:
URL: https://github.com/apache/daffodil-vscode/pull/458

         Significant modifications made to intellisense results
           - context logic change to use line and cursor position at trigger
           - functions developed to:
             - determine the tag at the context position
             - determine if the tag is open
             - determine if the trigger occured between tags
             - determine if a close tag is missing
   
           - Additional modifications made to:
             - provide above functionality if line contains multiple tags
             - provide intellisense based on tag at context position
             - simplify the logic to determine context
             - minimize if/else logic
   
           Closes 438
   
   :100644 100644 0735174 3140ba0 M        src/language/providers/attributeCompletion.ts
   :100644 100644 19c8ac0 8069ca8 M        src/language/providers/closeElement.ts
   :100644 100644 721f7f0 289055b M        src/language/providers/closeElementSlash.ts
   :100644 100644 cba6ee6 39d5ec0 M        src/language/providers/elementCompletion.ts
   :100644 100644 51ede84 eceb4e4 M        src/language/providers/utils.ts
   :100644 100644 8310ba5 d7608f6 M        src/tests/suite/language/items.test.ts
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] Shanedell commented on pull request #458: Significant modifications made to intellisense results

Posted by "Shanedell (via GitHub)" <gi...@apache.org>.
Shanedell commented on PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#issuecomment-1450446130

   @rt320 So I have got it nailed down to being for that function during the looping with `ic` and `io`. In my PR to your branch it is method `getItemsForLineLT2`, its stuck in an infinite loop.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] Shanedell commented on a diff in pull request #458: Significant modifications made to intellisense results

Posted by "Shanedell (via GitHub)" <gi...@apache.org>.
Shanedell commented on code in PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#discussion_r1130256200


##########
src/language/providers/intellisense/elementItems.ts:
##########
@@ -102,12 +102,42 @@ export const elementCompletion = (definedVariables, dfdlFormatString, nsPrefix)
       },
       {
         item: 'dfdl:defineVariable',
-        snippetString: '<' + nsPrefix + 'annotation>\n\t<' + nsPrefix + 'appinfo source="http://www.ogf.org/dfdl/">\n\t\t<dfdl:defineVariable name="$1"$0',
+        snippetString: '\t<dfdl:defineVariable name="$1"$0',
       },
       {
         item: 'dfdl:setVariable',
-        snippetString: '<' + nsPrefix + 'annotation>\n\t<' + nsPrefix + 'appinfo source="http://www.ogf.org/dfdl/">\n\t\t<dfdl:setVariable ref="${1|' + definedVariables + '|}"$0',
+        snippetString: '\t<dfdl:setVariable ref="${1|' + definedVariables + '"|}, value="$2"$0',
+      },
+      {
+        item: 'dfdl:defineFormat',
+        snippetString: '<dfdl:defineFormat name="$1" >\n\t$2\n</dfdl:defineFormat>$0',
+        markdownString: 'dfdl format name and configuration',
+      },
+      {
+        item: 'dfdl:defineEscapeScheme',
+        snippetString: '<dfdl:defineEscapeScheme name=$1 >\n\t$0,/dfdl:defineEscapeScheme>',
+        markdownString: 'dfdl escape character definition',
+      },
+      /*TODO not sure how to make dfdl:element work without braking xs:element 

Review Comment:
   I still approve of this PR just want to state that this should be added as a new issue if not done already.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] hdalsania commented on pull request #458: Significant modifications made to intellisense results

Posted by "hdalsania (via GitHub)" <gi...@apache.org>.
hdalsania commented on PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#issuecomment-1443961314

   > I'm not sure if this is a pre-existing bug or not, but I can't seem to close a tag, the editor keeps deleting the `>` symbol after I type it: ![sampleWorkspace-1677188626641](https://user-images.githubusercontent.com/31163/221037370-36f42a55-302e-46e2-ac45-f3f8b52e053e.gif) [ ![sampleWorkspace-1677188626641](https://user-images.githubusercontent.com/31163/221037370-36f42a55-302e-46e2-ac45-f3f8b52e053e.gif) ](https://user-images.githubusercontent.com/31163/221037370-36f42a55-302e-46e2-ac45-f3f8b52e053e.gif) [ ](https://user-images.githubusercontent.com/31163/221037370-36f42a55-302e-46e2-ac45-f3f8b52e053e.gif)
   
   I am not seeing this behavior with Visual Code version 1.74.3. We have seen some strange code IDE related auto-completion issues with Visual Code version 1.75.1. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] Shanedell commented on pull request #458: Significant modifications made to intellisense results

Posted by "Shanedell (via GitHub)" <gi...@apache.org>.
Shanedell commented on PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#issuecomment-1447027054

   Is there a possibility we would want to move to making a Language Server at some point? Some documentation is here [Language Server Guide](https://code.visualstudio.com/api/language-extensions/language-server-extension-guide). In the [RedHat vscode-xml](https://github.com/redhat-developer/vscode-xml/) extension repo they have this code:
   
   ```ts
     // Setup autoCloseTags
     const tagProvider = (document: TextDocument, position: Position) => {
       const param = languageClient.code2ProtocolConverter.asTextDocumentPositionParams(document, position);
       const text = languageClient.sendRequest(TagCloseRequest, param);
       return text;
     };
     context.subscriptions.push(activateTagClosing(tagProvider, { xml: true, xsl: true }, ServerCommandConstants.AUTO_CLOSE_TAGS));
   ```
   
   It seems to setup a provider to easily close tags and seems just less complicated than what we are doing currently. Any thoughts?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] Shanedell commented on pull request #458: Significant modifications made to intellisense results

Posted by "Shanedell (via GitHub)" <gi...@apache.org>.
Shanedell commented on PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#issuecomment-1447061377

   So I was able to get it semi work but I had to do
   
   ```xml
   <xsd:element name=""
   <xsd:element name=""
   ```
   
   Then add a `>` to end of the second `<xsd:element name=""` then it auto closed. So there must be a bug somewhere where it will only grab the line before instead of the actual line?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] Shanedell commented on pull request #458: Significant modifications made to intellisense results

Posted by "Shanedell (via GitHub)" <gi...@apache.org>.
Shanedell commented on PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#issuecomment-1446671598

   @arosien I actually do something similar now if I try to type in `/>` it auto deletes the `/` for some reason


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] Shanedell commented on pull request #458: Significant modifications made to intellisense results

Posted by "Shanedell (via GitHub)" <gi...@apache.org>.
Shanedell commented on PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#issuecomment-1442712553

   @arosien I am not seeing this when I checkout the code. Do you possibly have the extension already installed through the marketplace? If so maybe debugging locally and the other installed version are clashing? I am not sure if that's the case, just a thought since I am not seeing the same behavior.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] rt320 commented on pull request #458: Significant modifications made to intellisense results

Posted by "rt320 (via GitHub)" <gi...@apache.org>.
rt320 commented on PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#issuecomment-1458510076

   Not sure what you mean by the "triple ticks"


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] rt320 commented on pull request #458: Significant modifications made to intellisense results

Posted by "rt320 (via GitHub)" <gi...@apache.org>.
rt320 commented on PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#issuecomment-1450851056

   @Shanedell I think the infinite loop in getItemsForLineLT2 might be caused by the "<= 2" on line 397.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] rt320 commented on pull request #458: Significant modifications made to intellisense results

Posted by "rt320 (via GitHub)" <gi...@apache.org>.
rt320 commented on PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#issuecomment-1438652979

   Found a problem with context when intellisense is trigger at the start of the line of a multi-tag line, and also if trigger at the end of the line of a multi-tag line.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] arosien commented on pull request #458: Significant modifications made to intellisense results

Posted by "arosien (via GitHub)" <gi...@apache.org>.
arosien commented on PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#issuecomment-1444012801

   I've removed any older Daffodil extension and I get the deleting-end-tag behavior on VSCode 1.75.1. I'd like some logging in the extension to see what's being triggered.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] Shanedell commented on pull request #458: Significant modifications made to intellisense results

Posted by "Shanedell (via GitHub)" <gi...@apache.org>.
Shanedell commented on PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#issuecomment-1446952291

   I thinking we should not have a `slash` completion provider as it seems to break using a `slash` inside of the document all together.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] scholarsmate commented on pull request #458: Significant modifications made to intellisense results

Posted by "scholarsmate (via GitHub)" <gi...@apache.org>.
scholarsmate commented on PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#issuecomment-1460709592

   @arosien, please review this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] Shanedell commented on pull request #458: Significant modifications made to intellisense results

Posted by "Shanedell (via GitHub)" <gi...@apache.org>.
Shanedell commented on PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#issuecomment-1458485750

   @rt320 Also update you PR description with your latest commit message and don't have it surrounded with the triple ticks (```).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] arosien commented on pull request #458: Significant modifications made to intellisense results

Posted by "arosien (via GitHub)" <gi...@apache.org>.
arosien commented on PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#issuecomment-1443981351

   > I am not seeing this behavior with Visual Code version 1.74.3. We have seen some strange code IDE related auto-completion issues with Visual Code version 1.75.1.
   
   I have 1.75.1. What's "strange"?
   
   I'll see if what @Shanedell describes is happening: extension conflicts.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] rt320 commented on pull request #458: Significant modifications made to intellisense results

Posted by "rt320 (via GitHub)" <gi...@apache.org>.
rt320 commented on PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#issuecomment-1457309117

   I manually added Shane's modifications to my latest code.  I tested the resulting code in VS Code 1.74.3 and 1.76.0.  Everything I tested worked in both versions of VS Code. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] Shanedell commented on pull request #458: Significant modifications made to intellisense results

Posted by "Shanedell (via GitHub)" <gi...@apache.org>.
Shanedell commented on PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#issuecomment-1442237518

   @rt320 Some of code added is too much to be added in a single place. Consider breaking out some of these long flowing items into sub methods to break the code more to make it more modular.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] arosien commented on pull request #458: Significant modifications made to intellisense results

Posted by "arosien (via GitHub)" <gi...@apache.org>.
arosien commented on PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#issuecomment-1442471626

   I'm not sure if this is a pre-existing bug or not, but I can't seem to close a tag, the editor keeps deleting the `>` symbol after I type it:
   ![sampleWorkspace-1677188626641](https://user-images.githubusercontent.com/31163/221037370-36f42a55-302e-46e2-ac45-f3f8b52e053e.gif)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] Shanedell commented on pull request #458: Significant modifications made to intellisense results

Posted by "Shanedell (via GitHub)" <gi...@apache.org>.
Shanedell commented on PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#issuecomment-1450411493

   @rt320 That makes sense but have you seen these issues identified and possibly know why they are happening? I had made a PR to your fork to break out code and I think fix a couple issues. But I am something similar to what @mbeckerle stated in #366 where intellisense just stops working.
   
   If I have
   
   ```xml
   <xsd:element name=""
   ```
   then add a `>` the intellisense is now broken and if I do `Ctrl + Space` it just says `Loading...` forever


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] arosien commented on pull request #458: Significant modifications made to intellisense results

Posted by "arosien (via GitHub)" <gi...@apache.org>.
arosien commented on PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#issuecomment-1442487540

   I think there's some kind of algorithmic or infinite loop problem in this code. I can get a single XML tag to be suggested, but any further attempt doesn't show any suggestions while at the same time the "Code Helper (Plugin)" process is using 99% of a CPU.
   
   I don't see any logging or any other more direct signal about what's causing this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] rt320 closed pull request #458: Significant modifications made to intellisense results

Posted by "rt320 (via GitHub)" <gi...@apache.org>.
rt320 closed pull request #458:   Significant modifications made to intellisense results
URL: https://github.com/apache/daffodil-vscode/pull/458


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] rt320 commented on pull request #458: Significant modifications made to intellisense results

Posted by "rt320 (via GitHub)" <gi...@apache.org>.
rt320 commented on PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#issuecomment-1450005963

   @Shanedell There is no snippet defined for "dfdl:format ref".  The only reference I could find for it was in the file DFDLGeneralFormat.dfdl.xsd. This file seems to have been added when the code originally in dfdl.ts was split out into multiple files.  The original dfdl.ts file had a snippet defined as "defaultDfdlFormat" which is similar to the beginning of this file, but that snippet was removed.  This file seems to cause one of the issues Mike Beckerle brought up in issue #366.  I was planning to replace the file as part of the solution to issue #366.
   I downloaded the RedHat XML code and tried your example above in the code. This was the result when I pressed the slash key.
   ![image](https://user-images.githubusercontent.com/98881959/222129145-0a3f202f-2675-4a9f-82b6-079e14645a5b.png)
   This was the result when I pressed the '>' key.
   ![image](https://user-images.githubusercontent.com/98881959/222129491-0a1666a6-ef61-4315-8bf7-ad10d2db76b9.png)
   I also tried deleting an end tag in a multi-tag line and having the auto-complete re-insert the closing tag. When I pressed '>' another '>' was added to the end of the line. When I pressed slash I was given the option to add the missing end tag.
   ![image](https://user-images.githubusercontent.com/98881959/222131873-2273b94e-1e02-4cca-9e26-f5807e3e9d32.png)
   When I chose that option, the end tag was added, but the triggering slash was left in place.
   ![image](https://user-images.githubusercontent.com/98881959/222132081-be0479a5-ad92-4d94-a080-62759516f929.png)
   I haven't looked at the RedHat code. Possibly it offers a simpler coding solution, but does not seem to completely handle all situations.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] Shanedell merged pull request #458: Significant modifications made to intellisense results

Posted by "Shanedell (via GitHub)" <gi...@apache.org>.
Shanedell merged PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] rt320 commented on pull request #458: Significant modifications made to intellisense results

Posted by "rt320 (via GitHub)" <gi...@apache.org>.
rt320 commented on PR #458:
URL: https://github.com/apache/daffodil-vscode/pull/458#issuecomment-1458471083

   I'll modify the commit message and force push


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org