Beispiel #1
0
        private static bool CheckRazorLanguageQueryCapability(JToken token)
        {
            if (!RazorLanguageServerCapability.TryGet(token, out var razorCapability))
            {
                return(false);
            }

            return(razorCapability.LanguageQuery);
        }
        private static bool CheckRazorBreakpointSpanCapability(JToken token)
        {
            if (!RazorLanguageServerCapability.TryGet(token, out var razorCapability))
            {
                return(false);
            }

            return(razorCapability.BreakpointSpan);
        }
Beispiel #3
0
        private static bool CheckRazorProximityExpressionsCapability(JToken token)
        {
            if (!RazorLanguageServerCapability.TryGet(token, out var razorCapability))
            {
                return(false);
            }

            return(razorCapability.ProximityExpressions);
        }
        private static bool CheckRazorEditMappingCapability(JToken token)
        {
            if (!RazorLanguageServerCapability.TryGet(token, out var razorCapability))
            {
                return(false);
            }

            return(razorCapability.EditMapping);
        }
        private static bool CheckRazorServerCapability(JToken token)
        {
            // We're talking cross-language servers here. Given the workspace/didChangeConfiguration is a normal LSP message this will only fail
            // if the Razor language server is not running. Typically this would be OK from a platform perspective; however VS will explode if
            // there's not a corresponding language server to accept the message. To protect ourselves from this scenario we can utilize capabilities
            // and just lookup generic Razor language server specific capabilities. If they exist we can succeed.
            var isRazorLanguageServer = RazorLanguageServerCapability.TryGet(token, out _);

            return(isRazorLanguageServer);
        }