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

Go to define and find reference functions can not work well on java-script. #28684

Closed
gzx-miller opened this issue Jun 14, 2017 · 10 comments
Closed
Assignees
Labels
javascript JavaScript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@gzx-miller
Copy link

  • VSCode Version: Code 1.13.0 (376c52b, 2017-06-08T16:43:13.058Z)
  • OS Version: Windows_NT ia32 6.1.7601
  • Extensions:
Extension Author Version
rainbow-brackets 2gua 0.0.6
html-snippets abusaidm 0.1.0
python donjayamanne 0.6.5
vs-color-picker lihui 0.6.0
bash-debug rogalmic 0.0.7
code-settings-sync Shan 2.8.1
vscode-multiclip slevesque 0.1.2
JavaScriptSnippets xabikos 1.4.0
ReactSnippets xabikos 1.3.0
Material-theme zhuangtongfa 2.8.6

Steps to Reproduce:

@ramya-rao-a
Copy link
Contributor

@gzx-miller Please provide more details like sample code, any errors from the output pane for typescript, any errors in console etc.

@ramya-rao-a ramya-rao-a added the info-needed Issue requires more information from poster label Jun 14, 2017
@ramya-rao-a
Copy link
Contributor

@gzx-miller Does the Go to Definition and Find references work in smaller javascript files and just not in bigger files? Or they don't work in any javascript file?

@gzx-miller
Copy link
Author

@ramya-rao-a I find this problem have no relation with file size. I'm write the react java-script code. find this problem. but go to define can work well in ts code.

@gzx-miller
Copy link
Author

gzx-miller commented Jun 15, 2017

@ramya-rao-a There are more then 85% code oject or function can not go to define. When this problem happen, have a tip"未找到"xxxx"的任何定义", I used china version, so I have no english version tip.

@ramya-rao-a ramya-rao-a added javascript JavaScript support issues and removed info-needed Issue requires more information from poster labels Jun 15, 2017
@mjbvz mjbvz added the info-needed Issue requires more information from poster label Jun 19, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Jun 19, 2017

@gzx-miller Please put together a minimal code sample that shows this problem so that we can investigate

@gzx-miller
Copy link
Author

gzx-miller commented Jun 21, 2017

@mjbvz I write a demo java-script code based react, please try goto on "this.keyUP"

 var Text = React.createClass({
            getInitialState: function() {
                return {name: "react"};
            },
            keyUp: function(e){
                this.setState({name: e.target.value});
                console.log(this.state.name);
            },
            render: function() {
                return `(`
                    <div className="a">hello wrold{this.state.name}show me
                         <input onKeyUp={this.keyUp} />
                    </div>
                );
            }
        });
        ReactDOM.render(
            <Text></Text>,
            document.getElementById('well')
        );

@gzx-miller
Copy link
Author

@mjbvz if you can not reproduce this problem by this code, I can send email to you, please send your email address to my email address.

@gzx-miller
Copy link
Author

@ramya-rao-a This problem have no relation with file size.

@mjbvz mjbvz added upstream Issue identified as 'upstream' component related (exists outside of VS Code) and removed info-needed Issue requires more information from poster labels Jun 21, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Jun 21, 2017

@gzx-miller Thanks for the code

You are running into this TypeScript limitation: microsoft/TypeScript#16184 . TypeScript powers our JavaScript language features and it currently does understand what this refers to inside of object literals. Hopefully this will be fixed with TS 2.5

Closing as upstream

@mjbvz mjbvz closed this as completed Jun 21, 2017
@kingcean
Copy link

kingcean commented Jun 21, 2017

Sounds this issue is about the scenario that if you write React without ES6. When we create a React class by calling React.createReactClass or React.createClass function, the argument looks like a simple JSON but in fact it will be a part of class implementation so that this should point to that object.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
javascript JavaScript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

4 participants