简体   繁体   English

(函数,全局变量)之间的Visual Studio 2019脚本标记(在cshtml中)转到定义(F12)不起作用

[英]Visual Studio 2019 script tags (in cshtml) between (function,global variable) go to definition (F12) doesn't work

VS 2019 script tags (in cshtml) "Go to definition" doesn't work, but in VS 2015 it works. VS 2019脚本标签(在cshtml中)“转到定义”不起作用,但在VS 2015中起作用。

//javascript function in cshtml
<script>
function getSelectedItem() 
{
 var x = 100;
}

function onDetail() 
{
    var selectedItem = getSelectedItem(); //F12 go to definition doesn't work

    windowResult.SelectedItem = selectedItem;
    windowResult.Status = true;
}
</script>
//javascript global variable in cshtml

<script>

var _OperationType = 0;
var _FormType= 0;


function SetDefaultsParam()
{
    var param = {};
    param.Type= _OperationType;  //F12 go to definition doesn't work

    param.Formtype= _FormType;
    param.MasterId = _MasterId;
}
</script>

Function or global variable in cshtml ( F12 ) "Go to definition" gives "Cannot navigate to the symbol........." cshtml( F12 )中的函数或全局变量“转到定义”给出“无法导航至符号.........”

The Visual Studio development team like to stress using the "Search Visual Studio (Ctrl-Q)" to find options. Visual Studio开发团队喜欢强调使用“搜索Visual Studio(Ctrl-Q)”来查找选项。

搜索示例

Bring up your keyboard mapping and make sure the Edit.GoToDefinition is mapped to F12 for example. 调出键盘映射,并确保例如将Edit.GoToDefinition映射到F12。

In testing, if the function is empty, it won't jump to it. 在测试中,如果该函数为空,则不会跳转到该函数。 But when I put in a line of code inside the function, F12 worked like a charm. 但是,当我在函数中放入一行代码时,F12就像一个魅力。 I am running VS2019 16.1.0 Preview 2.0. 我正在运行VS2019 16.1.0 Preview 2.0。

键盘映射

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当按F12进入Visual Studio 2015 / C#中的定义时出现错误 - I got error when press F12 Go to definition in Visual Studio 2015 / C# Visual Studio转到定义(F12)打开对象浏览器而不是代码视图 - Visual Studio Go to Definition (F12) opens Object Browser instead of Code View 如何隐藏<summary>在 Visual Studio 代码中按 F12(转到定义)时的 [元数据]</summary> - How to hide <summary> in [metadata] when press F12 (Go to definition) in visual studio code VSCode C#“转到定义”(F12)不起作用 - VSCode C# "go to definition" (F12) not working Mysql 和 Visual Studio 2019 for macOS 之间的连接不起作用 - Conenection between Mysql and Visual Studio 2019 for macOS doesn't work Visual Studio Dom Explorer和IE F12工具Dom Explorer之间的区别 - Difference between Visual Studio Dom Explorer and I.E. F12 tools Dom Explorer Visual Studio 2019 进入定义状态,Intellisense 不起作用 - Visual studio 2019 go to definition and Intellisense not working 当使用不同装配中的步骤定义时,转到定义(F12)不起作用 - Go To Definition (F12) not working when step definitions are used from a different assembly “使用”行中的 Visual Studio for Mac 2022“转到定义”不起作用 - Visual Studio for Mac 2022 "Go to Definition" in "using" lines doesn't work 如何使用F12在Visual Studio中查看C#代码详细信息? - How to see the c# code detail in visual studio using F12?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM