question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[ST4] Accept replacement inline button missing

See original GitHub issue

Sublime Text Version

Sublime Text 4 (Build 4081)

Rust Enhanced Version

v2.22.0

Operating system

OS Name Linux Mint (Cinnamon) Version 20

Expected behavior

I should see the “accept replacement” message/button inline, with no errors in the console.

Actual behavior

I don’t see the button and associated text:

image

With this error log:

Parse Error: =2d755782-fdf6-4abf-86a5-bf217e635c2c" class="rust-button">Accept Replacement:</a> thing</div>

</div>

</body>
 code: Unexpected character
Parse Error: -fdf6-4abf-86a5-bf217e635c2c" class="rust-button">Accept Replacement:</a> thing</div>

</div>

</body>
 code: Unexpected character
Parse Error: -4abf-86a5-bf217e635c2c" class="rust-button">Accept Replacement:</a> thing</div>

</div>

</body>
 code: Unexpected character
Parse Error: -86a5-bf217e635c2c" class="rust-button">Accept Replacement:</a> thing</div>

</div>

</body>
 code: Unexpected character
Parse Error: -bf217e635c2c" class="rust-button">Accept Replacement:</a> thing</div>

</div>

</body>
 code: Unexpected character
Parse Error: " class="rust-button">Accept Replacement:</a> thing</div>

</div>

</body>
 code: Unexpected character
Parse Error: id=2d755782-fdf6-4abf-86a5-bf217e635c2c"  code: Unknown entity
Parse Error: ">Accept Replacement:</a> thing</div>

</div>

</body>
 code: Unexpected character
Parse Error: =2d755782-fdf6-4abf-86a5-bf217e635c2c" class="rust-button">Accept Replacement:</a> thing</div>

</div>

</body>
 code: Unexpected character
Parse Error: -fdf6-4abf-86a5-bf217e635c2c" class="rust-button">Accept Replacement:</a> thing</div>

</div>

</body>
 code: Unexpected character
Parse Error: -4abf-86a5-bf217e635c2c" class="rust-button">Accept Replacement:</a> thing</div>

</div>

</body>
 code: Unexpected character
Parse Error: -86a5-bf217e635c2c" class="rust-button">Accept Replacement:</a> thing</div>

</div>

</body>
 code: Unexpected character
Parse Error: -bf217e635c2c" class="rust-button">Accept Replacement:</a> thing</div>

</div>

</body>
 code: Unexpected character
Parse Error: " class="rust-button">Accept Replacement:</a> thing</div>

</div>

</body>
 code: Unexpected character
Parse Error: id=2d755782-fdf6-4abf-86a5-bf217e635c2c"  code: Unknown entity
Parse Error: ">Accept Replacement:</a> thing</div>

</div>

</body>
 code: Unexpected character

Steps to reproduce

  1. Run cargo new --lib bug-demo

  2. Paste this code into src/lib.rs:

    fn thing() {
        //
    }
    
    fn main() {
        thang()
    }
    
  3. Open Sublime log with <kbd>Ctrl</kbd> + <kbd>`</kbd>

This issue is also present with rust-analyzer (via LSP plugin) disabled, so I don’t believe it’s a conflict between the two.

References

N/A

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
Bobo1239commented, Nov 22, 2020

Seems like the URL parsing done by Sublime Text has changed and doesn’t accept the & in the URL encoded replacement info anymore. A quick hack is to just replace that character…

diff --git a/rust/messages.py b/rust/messages.py
index 19c2a58..294c59d 100644
--- a/rust/messages.py
+++ b/rust/messages.py
@@ -150,7 +150,7 @@ class Message:
             urllib.parse.urlencode({
                 'id': self.id,
                 'replacement': self.suggested_replacement,
-            }),
+            }).replace("&", "SEKOFRUHNSDIXFHSDUI"),
             html_suggestion,
         )

@@ -371,6 +371,7 @@ def erase_status(view):


 def _click_handler(view, url, hide_popup=False):
+    url = url.replace("SEKOFRUHNSDIXFHSDUI", "&")
     if url == 'hide':
         clear_messages(view.window(), soft=True)
         if hide_popup:
1reaction
jamwafflescommented, Aug 10, 2020

Dev versions are available on the Discord #announcements channel: https://discord.com/channels/280102180189634562/650695903446827011

Read more comments on GitHub >

github_iconTop Results From Across the Web

Accessible SVGs
Meaningful icons need alternative text. This method is very similar to the “Basic Image Replacement, Inline SVG Example.” Update the title text ...
Read more >
Missing CrossShip and Replace Buttons in RMA Entry...
Missing CrossShip and Replace Buttons in RMA Entry RMA line Windows. Hi Larry, It seems 'Use SOP' option is not marked in 'Contract...
Read more >
How do I fix the photo "trigger" button (missing)?
Hello,. The button that you press to take the photo recently came off. I don't have the button. A local repair shop said...
Read more >
shabegom/buttons: Buttons in Obsidian
Go to the note you want an inline Button and run the Insert Inline Button Command, or write the button-block-id between backticks, e.g....
Read more >
Display SVG element inline with Button element
I still want the button to keep it's width of 100%, if that is possible. Am I missing something? <html> <head> <style> ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found