If you are curious where is is the Shortcut key in the snippet file. Here is the screenshot.
The latest version snippets on the codeplex project does not have any shortcut key. You can download these snippets from codeplex project as well.
Although the shortcut key is removed, you still use Ctrl+K,X to show the snippet dialog.
let (|ValidFolder|_|) folder =
match folder with
| _ when (File.GetAttributes(folder) &&& FileAttributes.Directory = FileAttributes.Directory) -> Some ValidFolder
| _ -> None
let removeShortcutTag (xmlFile:string) =
let doc = XDocument.Load xmlFile
doc.Descendants()
|> Seq.tryFind (fun decendent -> decendent.Name.LocalName = "Shortcut")
|> function
| Some node ->
File.SetAttributes (xmlFile, ~~~FileAttributes.ReadOnly
&&& ~~~FileAttributes.Hidden
&&& ~~~FileAttributes.System)
node.Value <- String.Empty
doc.Save(xmlFile)
| None -> ()
let processXMLFiles folder =
let xmlFiles = Directory.GetFiles(folder, "*.snippet")
xmlFiles
|> Seq.iter (fun xmlFile -> removeShortcutTag xmlFile)
let rec processXML folder =
match folder with
| ValidFolder ->
let subFolders = Directory.EnumerateDirectories(folder)
processXMLFiles folder
subFolders
|> Seq.iter processXML
| _ -> ()
processXML @"C:\MyCode\fsharpcodesnippet"
No comments:
Post a Comment