Пример #1
0
        // Gets the language associated with this document context.
        public int GetLanguageInfo(ref string pbstrLanguage, ref Guid pguidLanguage)
        {
            // CLRDBG TODO: Add 'language' to the MI

            string fileExtension = _textPosition.GetFileExtension();

            if (fileExtension.Equals(".cs", StringComparison.OrdinalIgnoreCase))
            {
                pbstrLanguage = "C#";
                pguidLanguage = AD7Guids.guidLanguageCs;
            }
            // NOTE: Use a case sensitive comparison, since '.C' can be used for C++ on unix
            else if (fileExtension.Equals(".c", StringComparison.OrdinalIgnoreCase))
            {
                pbstrLanguage = "C";
                pguidLanguage = AD7Guids.guidLanguageC;
            }
            //else if (fileExtension.Equals(".vb", StringComparison.OrdinalIgnoreCase))
            //{
            //    pbstrLanguage = "VB";
            //    pguidLanguage = AD7Guids.guidLanguageVb;
            //}
            //else if (fileExtension.Equals(".fs", StringComparison.OrdinalIgnoreCase))
            //{
            //    pbstrLanguage = "F#";
            //    pguidLanguage = AD7Guids.guidLanguageFSharp;
            //}
            else
            {
                pbstrLanguage = "C++";
                pguidLanguage = AD7Guids.guidLanguageCpp;
            }

            return(Constants.S_OK);
        }
        // Gets the language associated with this document context.
        int IDebugDocumentContext2.GetLanguageInfo(ref string pbstrLanguage, ref Guid pguidLanguage)
        {
            // CLRDBG TODO: Add 'language' to the MI

            string fileExtension = _textPosition.GetFileExtension();

            if (fileExtension.Equals(".brs", StringComparison.OrdinalIgnoreCase))
            {
                pbstrLanguage = BrightScriptPackage.DefaultNamespace;
                pguidLanguage = AD7Guids.guidLanguageBrs;
            }

            return(VSConstants.S_OK);
        }