tcomment_vim icon indicating copy to clipboard operation
tcomment_vim copied to clipboard

javascriptreact(jsx) comment do like javascript

Open xiote opened this issue 4 years ago • 1 comments

  // App.jsx
  import logo from './logo.svg';
  import './App.css';
  
  function App() {
    return (
      <div className="App">
        <header className="App-header"/>
      </div>
    );
  }
  
  export default App;

:call tcomment#debug#CollectInfo()

TCOMMENT: &ft = javascriptreact => javascriptreact
TCOMMENT: stx = jsParen => javascriptParen
TCOMMENT: ct  = {'rxmid': '', 'rxend': '', '_args': {'beg': 7, 'fallbackFiletype': '', 'end': 7, 'filetype': 'javascriptreact', 'comment_mode': ''}, 'commentstring': '// %s', 'commentstring_rx': '\%%(// %s\|/* %s */\)', 'mode': '', 'filetype': 'javascript', 'replacements': {'*/': {'subst': '|)}>#', 'guard_rx': '^\s*/\?\*'}, '/*': {'subst': '#<{(|', 'guard_rx': '^\s*/\?\*'}}, 'rxbeg': '\*\+'}

gcc is wrong

  // App.jsx
  import logo from './logo.svg';
  import './App.css';
  
  function App() {
    return (
      <div className="App">
        // <header className="App-header"/>
      </div>
    );
  }
  
  export default App;

:TCommentAs jsx is Ok!

  // App.jsx
  import logo from './logo.svg';
  import './App.css';
  
  function App() {
    return (
      <div className="App">
        {/* <header className="App-header"/> */}
      </div>
    );
  }
  
  export default App;

How can i do gcc like commentAs jsx?

xiote avatar Dec 02 '21 08:12 xiote

The cursor is over the < and the trans syntax group is jsParen? What's the output of :echo synIDattr(synID(line('.'), col('.'), 0), 'name')?

tomtom avatar Dec 09 '21 12:12 tomtom